| The sqlite3 C API very much does not serialize "all operations within a single process." The way threading and concurrency work in SQLite may not mesh well with NodeJS's concurrency model. I dunno, I'm not an NodeJS/libuv expert. But at the C API level that statement is just wrong. Normally you cannot share a single connection across threads. If you compile SQLite to allow this, yes, it'll serialize operations using locks. The solution is to create additional database connections, not (necessarily) launch another process. With multiple database connections, you can have concurrency, with or without threads. https://sqlite.org/threadsafe.html Again, whether this is viable in NodeJS, I have no idea. But it's a Node issue, not a C API issue. BTW, we're commenting on a Ruby article, and SQLite in Ruby has seen "recent" advances that increase concurrency through implementing SQLite's BUSY handler in Ruby, which allows the GVL lock to be released, and other Ruby and SQLite code to run while waiting on a BUSY connection. https://fractaledmind.github.io/2023/12/11/sqlite-on-rails-i... |