Recently in a project, you need to use Elasticsearch to do a product search, what should be done to keep MySQL data and elasticsearch data in real-time synchronization, I can now think of is every time involved in the database operation to update Elasticsearch, but so the original program needs to modify the place is too much, because the original use of only MySQL, beg a better solution, thank you!!!
Reply content:
Recently in a project, you need to use Elasticsearch to do a product search, what should be done to keep MySQL data and elasticsearch data in real-time synchronization, I can now think of is every time involved in the database operation to update Elasticsearch, but so the original program needs to modify the place is too much, because the original use of only MySQL, beg a better solution, thank you!!!
How much is the daily change?
If the stock, sales and other frequent changes in data isolation, or periodic update, the frequency control is good.
My side is handled by a trigger.
http://www.toozy.cn/mysql-trigger-elasticsearch/