Ask HN: How do you design offline-first flows in large React Native apps?

2 pointsposted 2 months ago
by samwellx

Item id: 46360277

3 Comments

kobieps

a month ago

Not sure if you're open to using tools for this, but PowerSync solves those tricky things you listed (and many more you didn't list (disclaimer I'm on the team))

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

a month ago

Thanks, appreciate the link.

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

a month ago

Cool, makes sense. We still want to write a blog post about how we built powersync that will go into more detail on the points you raised.

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...