This project uses SQLite compiled to WebAssembly in the browser as the database, and provides collaborative funcionalities using WebRTC. Evey peer has

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-10-25 17:00:13

This project uses SQLite compiled to WebAssembly in the browser as the database, and provides collaborative funcionalities using WebRTC.

Evey peer has their own SQLite DB in their browser, and SQL statements are sent to peers using WebRTC, providing a private and secure way to share and manipulate data.

This has the benefit of being private and secure because the database and the queries run on it are shared between you and you peers only.

I initially used PGLite which has excellent documentation and is very easy to use, but found it too heavy for this use case. SQLite is lighter and more suitable to running a database in the browser.

The docs for running SQLite in a web worker with persistance weren't easy, and I eventually had to add a bit of code to SQLite's WASM glue to make it easier to use.

I copied my existing WebRTC app project and removed unnecessary parts (video/audio/screen sharing), and kept DataChannels. So for more resources about WebRTC you can check my WebRTC repo.

Leave a Comment