简体   繁体   中英

Where to store data for a search index?

I'm building a search index (Elasticsearch) for existing data in a relational database. Is it common to have duplicated in both the relational database as well as the search index? Or should it just be the search index? How safe is it to have your data stored entirely on say the Elasticsearch cloud?

It's a common pattern to have data in both systems:

  • datastore: source of truth. Only used for CRUD
  • search engine: Where all queries are sent

If you can afford some data loss (depending on your use case) in very corner cases, then having only data in elasticsearch could be ok.

I recommend reading carefully this page: https://www.elastic.co/guide/en/elasticsearch/resiliency/current/index.html

I Would recommend keeping both the RDBMS as a storage and Index file of Elastic Search to have data.

You can run reindexing of the Elastic search every day at midnight to keep the data up to date.

If the Index file corrupts, you still have data in RDBMS, which can be used to rebuild the index later.

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