app-search-firestore-extension icon indicating copy to clipboard operation
app-search-firestore-extension copied to clipboard

Is it guaranteed that Elastic App Search engine will always have up-to-date data?

Open ntofigzade opened this issue 3 years ago • 0 comments

I looked at the source code and noticed that the changes to a Cloud Firestore document are tracked by listening to the Cloud Firestore onWrite event and shipped to an Elastic App Search engine.

However, Cloud Firestore does not guarantee the ordering of background function invocations. Rapid changes to a document can trigger function invocations in random order. (https://firebase.google.com/docs/functions/firestore-events#limitations) Then in scenarios like rapid updates to a document (e.g. different services might update different fields of a document), a stale snapshot of a document will be shipped to the App Search engine after the up-to-date snapshot. As a result, the Elastic App Search engine will be out of sync with Cloud Firestore.

Are the above observations correct?

ntofigzade avatar Sep 25 '22 20:09 ntofigzade