简体   繁体   中英

How to Synchronize the DB from Index Using Elasticsearch

I have an use case where an Elasticsearch index and a MySQL Database should be remain synchronized and meet the following conditions.

1) Whenever I insert/update/delete in Elasticsearch index it should be synchronized with the Database(MySQL).

2) This synchronization should be done instantly.

3) For the Elasticsearch Index I am doing insert/update/delete at any time with any number of requests.

How can I do this using Elasticsearch?

Thanks!!

Check this out - Listener for ES

So this is essentially a listener which gets invoked when the index gets updated / deleted . So override the method postCreate ,postIndex and postDelete and accordingly update the MySQl DB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM