5 ms·
There are benefits to having a single writer connection (and multiple readers). One is that you can get fairer and more efficient locking. The (interruptible)
by ncruces 2y ago
There are benefits to having a single writer connection (and multiple readers).
One is that you can get fairer and more efficient locking. The (interruptible) file lock APIs that SQLite uses lead to a lot of sleeping and retrying that wastes time, and is not very fair.
https://fractaledmind.github.io/2024/07/19/sqlite-in-ruby-backoff-busy-handler-problems/ https://fractaledmind.github.io/2024/07/19/sqlite-in-ruby-ba...
Another some APIs, like the backup API, work better if they can track writes, and (e.g.) backing up from the single writer connection helps there.