The replaceAllObjects method in Algolia is a powerful tool for completely replacing the content of an index. However, it’s designed for occasional full replacements, not for frequent or real-time updates.
Recommended frequency
Even for small datasets, we recommend running replaceAllObjects no more than 1–3 times per month. This guidance helps you avoid performance issues and ensures data consistency.
Good to know: Algolia doesn’t count the 3 days with the highest record count each month toward your quota. This provides some flexibility when running large replacement operations.
Why not use it frequently?
Running replaceAllObjects too often can lead to the following issues:
Temporary doubling of records
During the replacement process, the method creates a new copy of the data before switching over, which temporarily doubles your record count.Latency spikes
Search performance may be briefly impacted while the new index is being created.Risk of partial failure
If the process fails mid-replacement, the index could end up empty or incomplete, affecting your live search experience.Rate limits and throttling
Repeated large operations can trigger rate limiting or throttling, which may delay subsequent indexing jobs.
Preferred alternative: partialUpdateObjects
To update data more efficiently and safely, we recommend using partialUpdateObjects along with batching. This approach lets you:
Update only the necessary records
Avoid creating a temporary duplicate index
Maintain live search consistency without interruption
Summary
Use
replaceAllObjectssparingly, 1-3 times per monthAvoid real-time or frequent use due to performance and consistency risks
For regular updates, switch to
partialUpdateObjectsand batching