Hacker News new | ask | show | jobs
by btown 2961 days ago
For those wanting an open-source/self-hosted PWA solution with arbitrary offline data, Apollo is quickly getting there. You can see an (awesome) state-of-the-union roundup at https://github.com/benseitz/apollo-link-offline/issues/1#iss... .

The real problem with all of these systems is that it's very hard to get arbitrary offline mutations "right." For instance, a GraphQL mutation changing nested objects would likely need to translate to a database transaction... and although Firestore supports such transactions, it doesn't support them offline: https://firebase.google.com/docs/firestore/manage-data/trans...

Of course, if you can structure your data such that it can be represented by a CRDT - https://en.wikipedia.org/wiki/Conflict-free_replicated_data_... - offline sync comes much more naturally. https://irisate.com/crdt-for-real-time-collaborative-apps/ is a great writeup that includes links to some actively-developed JS libraries.