5 ms·
When SQLite is in WAL mode, writes queue up, but reads are concurrent. Writes do not actually "queue" in one place, rather each reader will have a busy_timeout
by justsomeuser 6y ago
When SQLite is in WAL mode, writes queue up, but reads are concurrent.
Writes do not actually "queue" in one place, rather each reader will have a busy_timeout, which is basically polling the file to see if it is write-lock-free. If you have a single application, you might want to queue the writes yourself inside the application to prevent polling the file.
Writes typically happen very fast, so as long as your application is not using more than 100% of possible write capacity you would be fine, in theory. WAL mode is typically fast for writes because the OS caches many transactions, and only does an expensive "checkpoint"/fsync once every X transactions.
Try it out, move to another db if it does not work would be my advice.
- iio7 5y agoThanks! The busy_timeout was the heart of the matter :)