Update documents or swap indexes? #5208
-
I’m working on an e-commerce project with a dataset of approximately 500k products, stored in Business Central. This data is updated daily (e.g., price changes). I'm currently researching the best way to synchronize these updates with a Meilisearch index. Our main concern is avoiding downtime for users during the synchronization process. We anticipate daily updates that could involve a few thousand documents or sometimes all of them. Would it be better to update these documents incrementally, or should we create a temporary index with the updated data and swapping it with the current index once ready? Additionally, are there specific performance considerations or best practices when handling frequent updates in Meilisearch? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @alehandraxx, |
Beta Was this translation helpful? Give feedback.
Hello @alehandraxx,
It depends on your machine's performance. If your machine is able to ingest all 500k documents in 1 task, then do it. It's the simplest process, so don't bother doing something else.
However, if you have a small machine and want to avoid crashes, I suggest creating a new index. Start by putting your settings and then adding your documents in batches. At the end, swap and delete the old index, it's the safe way.