3 ms·
There’s a whole world of syncing databases when they’re offline and then reconnect. Local first. If your websocket connection is offline you have to store the i
by nikodotio 1y ago
There’s a whole world of syncing databases when they’re offline and then reconnect. Local first. If your websocket connection is offline you have to store the incremental changes to your data and send them later on reconnect. This gets complex fast.
A lot of these tools (and what the author wrote) offer toolkits to do this well, not having to implement and track all these changes in state manually.
In this case the author is running SQLite in the browser, and that syncs to SQLite on the server.
- aatd86 1y agooh ok. What does it require? CRDTs?
- nikodotio 1y agoAmong other things, but even with a “latest change wins” method you still have to make sure all transactions arrive, data doesn’t stay out of synch forever, and other challenges. ElectricSql, instantdb, rxdb, jazz.tools, are some of the things I’ve been looking into to make these tasks easier.