benbjohnson / litestream

Streaming replication for SQLite.
https://litestream.io
Apache License 2.0
11.1k stars 256 forks source link

Browser support #576

Closed hugo082 closed 8 months ago

hugo082 commented 8 months ago

Hi guys 👋

I wonder if it would be possible to use litestream directly from the browser taking advantage of Web Assembly & web containers 🤔

It would be very useful to deploy decentralized / low-budget applications that primarily use client-side executions. Having litestream ensure that the database is synchronized with the bucket / master file would allow these applications to share state between clients.

What do you think? I'll probably try to do it, but I'd like to have your opinion / first idea of the problems I might encounter.

benbjohnson commented 8 months ago

hey @hugo082 👋

You might be able to get Litestream to compile to WASM but it's gonna be a lot of work and the file will probably be huge. Also, Litestream does physical replication so it would make it difficult or impossible to synchronize a local and remote database that got out of sync.

You probably want to look into some local-first solutions for SQLite instead. Those might be a better fit.