I keep hearing that WAL mode is the mode one should use for a high-performance concurrent application.
So what IS WAL mode?
WAL mode:
SQLite appends changes to a separate -wal file instead of overwriting the main DB immediately. Readers read from the main DB + WAL without locking; writers append to the WAL. Readers and writers don't block each other. A checkpoint later merges the WAL back into the main DB.
And...what then is the default?
Rollback Journal Mode (the default)
Default (rollback journal mode): SQLite writes changes to the main database file, plus a separate rollback journal file. While writing, other readers are blocked. One writer at a time, readers wait.
So why is WAL not the default if it's supposedly "better"?
- Backward compatibility — older SQLite versions can't read WAL databases.
- Extra files — creates -wal and -shm sidecar files that can confuse backup tools or network filesystems.
- Checkpoint overhead — the WAL needs periodic checkpointing, which can cause brief write stalls.
- Not ideal for read-mostly, tiny embedded use cases — the default journal mode is simpler and fine for single-user/local apps.
Bottom line:
WAL is strictly better for concurrent read/write (web apps), but the default stays journal mode for compatibility and simplicity. You can enable it per-connection with PRAGMA journal_mode=WAL; — it's a persistent setting on the database file, not just the connection.