Disks Lie: Building a WAL that actually survives

3 points by emschwartz


snej

SQLite doesn't follow the two-WALs or direct-write recommendations and is still a highly reliable database.

In a database, writes don’t have to be durable until the point that a transaction is committed. If the db crashes or power is lost before a commit, any writes in that partial commit must be ignored when the db recovers. So all it has to do is scan the WAL up through the last committed entry.

It’s the commit that's important: that's when all the writes have to be flushed safely.