Home > Backend Development > PHP Tutorial > How to keep mysql data and Elasticsearch data synchronized in real time?

How to keep mysql data and Elasticsearch data synchronized in real time?

WBOY
Release: 2016-07-06 13:53:57
Original
1547 people have browsed it

I am working on a project recently, and I need to use Elasticsearch to do a product search. What should I do to keep mysql data and Elasticsearch data synchronized in real time? All I can think of now is to update every time it involves database operations. Elasticsearch, but in this case, there will be too many modifications to the original program, because the original program only uses mysql. Please provide a better solution, thank you! ! !

Reply content:

I am working on a project recently, and I need to use Elasticsearch to do a product search. What should I do to keep mysql data and Elasticsearch data synchronized in real time? All I can think of now is to update every time it involves database operations. Elasticsearch, but in this case, there will be too many modifications to the original program, because the original program only uses mysql. Please provide a better solution, thank you! ! !

How big are the daily changes?
If frequently changing data such as inventory and sales volume are isolated, or updated periodically, the frequency is controlled.
I handle it through triggers.
http://www.toozy.cn/mysql-trigger-elasticsearch/

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template