What is WAL mode in SQLite, and when should I use it?
What WAL mode changes compared with the default rollback journal, what it costs, when not to use it, and how to turn it on, check it and switch back.
#concurrency#configuration#transactions

Embedded database
A tiny, serverless SQL engine inside everything.
A self-contained, zero-configuration SQL database stored in a single file. Embedded in phones, browsers and countless applications — and increasingly used on servers too.
What WAL mode changes compared with the default rollback journal, what it costs, when not to use it, and how to turn it on, check it and switch back.
#concurrency#configuration#transactions
Why Python raises "database is locked", how timeout, isolation_level and autocommit interact, and the working pattern for threads, worker processes, SQLAlchemy, Django and aiosqlite.
#concurrency#locking#orm
How the -wal and -shm files, read marks and checkpoints work, why a WAL grows without bound, and how to set checkpointing, journal_size_limit and synchronous.
#concurrency#configuration#internals
An ordered procedure for SQLITE_BUSY with a verification for each step, a script that reproduces the contention, and the matching settings for Python, Node and Go drivers.
#concurrency#locking#troubleshooting
What SQLITE_BUSY means, where it is returned in rollback-journal and WAL mode, why a timeout sometimes does nothing, the extended codes, and how to find who holds the lock.
#concurrency#internals#locking
Still getting SQLITE_BUSY with a timeout set? The default timeout is zero and deferred transactions can't wait. WAL mode, busy_timeout and BEGIN IMMEDIATE fix most cases.
#concurrency#locking#troubleshooting
SQLite can serve real production traffic. Here's how WAL mode changes concurrency, which PRAGMAs to set, and where the limits are.
#concurrency#internals#performance
What SQLite is, how to start using it, how its flexible typing, foreign key and locking defaults differ from server databases, and when it is the right choice.