The tricky parts are: – optimistic updates – temporary client IDs – retryable request queues – keeping UI responsive while syncing in the background – avoiding tight coupling between networking and domain state
I’ve seen apps turn into a mess once these concerns start leaking everywhere.
For those who’ve built offline-first mobile apps at scale: – how do you usually structure this? – what breaks first? – what would you not do again?
I’m experimenting with my own approach, but I’m very curious how others solved this in production.
kobieps•1mo ago
We also have docs for common offline-first use cases. For temporary client IDs, see https://docs.powersync.com/usage/sync-rules/client-id#postgr...
Those strategies are broadly applicable no matter the stack, PowerSync just takes care of some of the details.
samwellx•1mo ago
I’m mostly interested in the architectural side rather than a specific tool: how people separate domain state from transport, where optimistic state lives, and how retry / reconciliation is usually modeled without leaking everywhere.
Still useful to see how existing systems approach client IDs though.
kobieps•1mo ago
The one thing I'll add is we found "keeping UI responsive while syncing in the background" is highly platform dependent since all platforms have their quirks, but for React Native we have a detailed blog post and code (admittedly tightly coupled to powersync, but should provide a starting point) https://www.powersync.com/blog/keep-background-apps-fresh-wi...