← Back to context

Comment by austinjp

1 year ago

I've been pondering similar regarding data persistence. One half-assed idea I have is simply to prompt the user to save the data regularly. A reminder with a button/link which triggers data serialisation from storage and then triggers the save dialogue. The serialisation/save could be triggered manually any time. A reciprocal import would also be needed of course.

Another similarity half-baked plan is for a PWA to regularly post (encrypted?) data to a service I'd host that simply forwards the data to the user's choice of cloud storage. It would require initial setup and probably regularly refreshing token, but should be workable.

The self-hosted app Actual Budget [1] sort of takes the second approach, where each client maintains their own SQLite database in local storage. However, instead of just hosting a single file database, the server maintains a list of migrations and is able to resolve conflicts between multiple clients. Clients push/pull the migrations when syncing to keep their database up-to-date. E2EE is also supported. The original creator, James Long, has done talks about the architecture if you want to learn more [2, 3].

[1] https://actualbudget.org/

[2] https://www.youtube.com/watch?v=2dh_gtndayY

[3] https://www.localfirst.fm/7