You have a Python daemon running on an Oracle Cloud Always Free instance. It polls IMAP every 2.5 minutes, updates a local state machine, and occasionally writes to a queue. You assume SQLite is too simple for this. You are wrong. But you are also wrong if you think the default journal mode is sufficient for a system that never sleeps.
The default rollback journal mode in SQLite is a bottleneck for concurrent writers. If your daemon is reading while a background process writes, you hit SQLITE_BUSY . In a 24/7 environment, this isn't just a log warning; it’s a silent failure where state gets out of sync, or worse, the process crashes and systemd restarts it, losing in-memory context.
The fix is Write-Ahead Logging (WAL). It is not a feature you enable once and forget; it is a concurrency model you must respect.
Why WAL Changes the Game
In rollback journal mode, a write transaction locks the entire database file. Readers must wait. In WAL mode, writes go to a separate -wal file.…