News for hackers. Stuff that matters.
Re:Cloud Firestore: A New Document Database for Apps by cfilipov on Tuesday October 03, 2017 @01:15PM (#15394055)
Regarding offline mode. How is sync done? Is this OT based? How are conflicts resolved?
Re:Cloud Firestore: A New Document Database for Apps by mikelehen on Tuesday October 03, 2017 @02:16PM (#15394656)
Good question, and to answer this well we should probably do a blog post or something. In the meantime you could dig into the code since the clients are all open source. :-)

But basically, sync is split into two halves: writes and listens. Clients store pending writes locally until they're flushed to the backend (which could be a long time if the app is running offline). While online, listen results are streamed from the backend and persisted in a local client cache so that the results will also be visible while offline (and any pending writes are merged into this offline view). When a client comes back online, it flushes its pending writes to the backend which are executed in a last-write-wins manner (see my answer above to ibdknox for more details on this). To resume listens, the client can use a "resume token" which allows the backend to quickly get the client back up-to-date without needing to re-send already retrieved results (there are some nuances here depending on how old the resume token is, etc.).

Re:Cloud Firestore: A New Document Database for Apps by cfilipov on Tuesday October 03, 2017 @02:29PM (#15394769)
Thank you!