That's what absurd SQL is for (link in the parent comment).
The repo's readme is a bit misleading and it does make it look like a mad scientist experiment but you can read more about it here (really interesting stuff): https://jlongster.com/future-sql-web
Obviously this project is still young, but I find it convincing (disclaimer: I don't use it yet).
It is only a matter of time before browsers implement the proposed sandboxed virtual file system apis with block level access and this would be superseded.
[1] https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aw...
Having clients running on read-only mode, when possible, can help.
Also partitioning the database can help, but then it's too much trouble already.
I did just that at my (now defunct) startup a few years ago. We were building a collaborative database query tool. The software we built used sqlite to keep a local db for storing user credentials, caching query results, etc. Bonus, we were able to have the local database file be encrypted protecting the data at rest.
Very useful for pure go applications!
So you need to be carful how you design your schema, but very possible.
One option is to use something like Yjs and a JSON column to get proper CRDTs for merging.
SQL.js[0] and the incredible “Absurd SQL”[1] are making it possible to build PWAs and hybrid mobile apps with a local SQL db. Absurd SQL uses IndexedDB as a block store fs for SQLite so you don’t have to load the whole db into memory and get atomic writes.
Also I recently discovered the Session Extension[2] which would potentially enable offline distributed updates with eventual consistency!
I can imagine building a SAAS app where each customer has a “workspace” each as a single SQLite db, and a hybrid/PWA app which either uses a local copy of the SQLite db synced with the session extension or uses a serveless backend (like CloudFlare workers) where a lightweight function performs the db operations. I haven’t yet found a nice way to run SQLite on CloudFlare workers, it need some sort of block storage, but it can’t be far off.
0: https://sql.js.org/
1: https://github.com/jlongster/absurd-sql
2: https://www.sqlite.org/sessionintro.html