dyedgreen / deno-sqlite

Deno SQLite module
https://deno.land/x/sqlite
MIT License
409 stars 36 forks source link

What would it take to make WAL work? #158

Closed lusbuab closed 2 years ago

lusbuab commented 2 years ago

In #152 file locking for VFS was introduced.

I'm wondering what features are still missing to get WAL mode working.

dyedgreen commented 2 years ago

To utilize WAL mode, deno would need to support memory mapped files. I’m not sure how feasible that would be.

andykais commented 2 years ago

Looks like absurd-sql also decided to avoid solving this

There’s also write-ahead logging, or “WAL mode”. This can be more efficient if working with a real disk. However, to achieve its performance it requires things like shared memory using mmap and things like that. I don’t think we can reliably map those semantics onto IndexedDB, and I don’t even see the point. WAL potentially adds more overhead if we’re just writing them all to IDB anyway. The structure of the writes isn’t as important to us.

pikeas commented 2 years ago

WAL mode support is necessary for replicating and backing up SQLite with https://litestream.io/