Search code examples
databasesqlite

What is the maximum number of connections for a SQLite3 database?


What is the maximum number of connections for a SQLite3 database?

Why can't I use it for very big websites, for example with 3 million users?


Solution

  • http://sqlite.org/whentouse.html explains "Situations Where Another RDBMS May Work Better":

    Many concurrent writers? → choose client/server

    If many threads and/or processes need to write the database at the same instant (and they cannot queue up and take turns) then it is best to select a database engine that supports that capability, which always means a client/server database engine.

    SQLite only supports one writer at a time per database file. But in most cases, a write transaction only takes milliseconds and so multiple writers can simply take turns. SQLite will handle more write concurrency than many people suspect. Nevertheless, client/server database systems, because they have a long-running server process at hand to coordinate access, can usually handle far more write concurrency than SQLite ever will.