News for hackers. Stuff that matters.
Re:LiteFS a FUSE-based file system for replicating SQLite by liuliu on Tuesday July 26, 2022 @03:47PM (#32243018)
Does LiteFS needs to do "pattern matching" to know what SQLite writes (a txn or not e.g.)? With Litestream, it seems simply use SQLite API. Just curious how do you think through this.
Re:LiteFS a FUSE-based file system for replicating SQLite by benbjohnson on Tuesday July 26, 2022 @03:59PM (#32243191)
Transactions start with the creation of the journal file and end when it's unlinked so there's some "pattern matching" but it's not terribly complicated. Once the file is unlinked, LiteFS can read and verify the journal and pull the change set of pages from the database file.

Litestream interacts with the SQLite API for locking but it uses a regular file descriptor to read the WAL. It has to do similar parsing of pages but it's a bit more complicated since it needs to re-verify its position every time it reads from the WAL.

Re:LiteFS a FUSE-based file system for replicating SQLite by liuliu on Tuesday July 26, 2022 @04:22PM (#32243459)
I am under the impression that if you are in the WAL mode, there is no rollback journal created?
Re:LiteFS a FUSE-based file system for replicating SQLite by ngrilly on Wednesday July 27, 2022 @02:43AM (#32247539)
Yes, there is no rollback journal in WAL mode, but the WAL is its own file.