4 ms·
WAL mode does have some slight decrease in durability by default. If you pull the power immediately after a commit the commit may be reverted when you come back
by dinosaurdynasty 4y ago
WAL mode does have some slight decrease in durability by default. If you pull the power immediately after a commit the commit may be reverted when you come back up.
But yeah most of the time it isn't an issue.
- markusw 4y agoThis is news to me. What’s your source for that? AFAIK, SQLite is fully and completely ACID also in WAL mode.
- dinosaurdynasty 4y agohttps://www.sqlite.org/pragma.html#pragma_synchronous https://www.sqlite.org/pragma.html#pragma_synchronous When synchronous is NORMAL (1), the SQLite database engine will still sync at the most critical moments, but less often than in FULL mode. There is a very small (though non-zero) chance that a power failure at just the wrong time could corrupt the database in journal_mode=DELETE on an older filesystem. WAL mode is safe from corruption with synchronous=NORMAL, and probably DELETE mode is safe too on modern filesystems. WAL mode is always consistent with synchronous=NORMAL, but WAL mode does lose durability. A transaction committed in WAL mode with synchronous=NORMAL might roll back following a power loss or system crash. Transactions are durable across application crashes regardless of the synchronous setting or journal mode. The synchronous=NORMAL setting is a good choice for most applications running in WAL mode.
- markusw 4y agoInteresting, thanks! I didn’t know this was a configurable tradeoff. Might update the article with a little bonus info.
- deleted 4y ago[deleted]