I’m building an app using Algolia and Firebase.
To use Algolia, I’m using the following firebase extension so that everytime new data is added, edited, updated to firestore, the same record is kept in Algolia.
Everything works well except it takes around 1-2 minute to store the record in Algolia (currently has around 15000+ records).
I’m currently reading and displaying data straight from Algolia and updating it whenever the data gets changed. However it seems absurd to wait 1-2 minutes before user can finally see the updated details.
I’m using Algolia because I need more flexible search options + page offset pagination. If I could do that with just firestore, I would happily just read data straight from firestore.
But since that’s not possible Can anyone see a better option?
I’ve already tried writing a custom trigger instead of the extension but the speed seems to be the same.
That seems to be the expected behaviour. Algolia’s documentation has a dedicated page for that topic:
Why aren’t my objects immediately available for search after being added?.
When you add or update a record, our servers reply to your request as soon as they understand the operation, but the actual indexing starts a few seconds later, asynchronously.
They also say it may take a few seconds (or minutes) for the new documents to be available. You can read more about how fast is the indexing?. It says, indexing may be slower on shared clusters. Upgrading to dedicated clusters may be helpful. That being said, time taken for indexing does not depend on whether you are using the extension, custom cloud function or your own servers to add data in Algolia.