by evtaylor · 3y ago · 0 comments
For example in my budgeting app:
- All of the user's budget data is stored client side in IndexedDB
- Offline support via a service worker
- Peer to peer synchronization between devices via WebRTC data channel
- Lightweight IdP server which also handles the WebRTC signalling (via web sockets)
This setup is nice because the user's data never touches the server and very little server side infrastructure is needed (none at all if you don't need data synchronization). One downside with the data sync is that both devices must be online with the app open at the same time to sync, but perhaps this could be improved with web workers?[1] https://github.com/actualbudget/actual
[2] https://github.com/actualbudget/actual/blob/d1e57340b88960d0...
This also means that I need to have a constantly running web worker on my phone/tablet etc...? In my time I am also trying to solve this problem of "data never touching a server" but I believe we're not there yet, despite all the devices we have: sometimes the smart watch is off, sometimes the laptop is off, etc., so you need a mechanism similar to "Google drive", and who never had sync issues with that? And that's a supercentralized solution. It's super hard to "merge" in a distributed async system.