Join Nostr
2025-06-04 16:31:47 UTC

nytpu on Nostr: One annoying thing about SQLite's documentation (especially since most of it is so ...

One annoying thing about SQLite's documentation (especially since most of it is so good) is how they talk about concurrent database access. They talk about how SQLite is fully multi-process safe but requires you to enable locking (which slows down the DB a lot) to be thread-safe.

But what they're really talking about is completely orthogonal to threads vs. processes, they just mean that SQLite needs locking to concurrently use **one connection object**, but is safe to access concurrently from multiple connections to the same database file. Even with the locking fully disabled, it doesn't matter if it's threads rather than processes that are accessing the DB concurrently as long as each one has its own separate connection (and I imagine if you tried hard enough you could probably have multiple processes share one connection object and corrupt it)