跳至主要内容

博文

目前显示的是 八月, 2018的博文

Elasticsearch MySQL Sync Challenge (1)

Elasticsearch MySQL Sync Challenge (1) Today, Tony was called into team leader’s office. The leader said, “You have done a great job to finish the basic search engine implementations recently. Now, we have another very challenging task for you to do: To sync the data between database and ES. Do you have any ideas?” Tony said, “em, for now, I can only come up with the idea that we write some codes in business layer to write another copy of data to ES.” Leader, “This is a way, but there exists other methods that deserve to be dive into. You can do some research and we will talk about it later. But remember our requirements of this sync job” Aims Updated asynchronously - The user’s database query request search request should be delayed as little as possible. Eventually consistent - While it can lag behind slightly, serving stale results indefinitely isn’t an option. Easy to rebuild - Updates can be lost before reaching Elasticsearch, and Elasticsearch itsel...