I'm doing a school project about CMS System to help operate my school website. It use 3 database:
- MongoDB (Head database, store all information)
- Redis (Store the menu of website)
- Elasticsearch (Store posts)
Currently when I insert/edit/delete data, I also insert/edit/delete to a related database. But my mentor want me to write a function that let's system auto sync data between those 3 database at a specific time (user can choose when).
My server uses Node JS to operate, this requirement is new for me, never heard about it before. My new approach is:
- Add 1 flag to database field
- Select all rows which contain flag == true.
- Sync data
But I don't know how to auto run above function at a specific time. I hope you guys can help me to optimize my new flow and solve the sync problem.
Thank you all !!!
via Huy
No comments:
Post a Comment