60  Sqlite journal modes

Journal modes controls how sqlite guarantees ACID principles of isolation and durability. Note that independent of journal modes, sqlite is always guarantees serializable isolation and durability. Journal modes is about how fast they work, backward compatibility and working environment.

Sqlite has two journal modes

We can check which journal_mode our database is working with following pragma command.

PRAGMA journal_mode;

if the command returns delete, we are running with old rollback mode.

rollback mode sqlite documentation

Demo - show rollback mode with a transaction.

We can change to wal mode using following command.

PRAGMA journal_mode=WAL;

Wal mode has advantages and disadvantages. But in my opinion, advantages exceed disadvantages. Especially following two advantages are very important.

Wal in sqlite documentation