3 ms·
Yeah, this is right on the money. I've worked in data sync the last four years, supporting an app that's used in rural parts of the developing world. Unfortunat
by eloff 11y ago
Yeah, this is right on the money. I've worked in data sync the last four years, supporting an app that's used in rural parts of the developing world. Unfortunately offline sync was the only available option. What I learned from the experience is that sync is a super hard problem, that conflicts are inevitable, and that you should sync as much information and context as possible. Sync the higher level business actions, not low level data. Because when there's a conflict, you need the extra context to allow the user to resolve it in a sensible way. If you only synced low level data, you frequently find it's impossible to recover from some kind of conflicts.
- pgte 11y agoPouchDB has great support for getting conflicts and merging them, it doesn't have to be dealt with at the sync layer. Since the client is the owner of the PouchDB database, it has direct access to conflicts and can fix them on the spot. Your data should be devised to be easily mergeable. Some document schemas are more easibly mergeable than others, CRDTs being the easiest extreme I know.