SQL without a server
SQLite is a relational database engine that operates without a separate server process. Created by D. Richard Hipp in 2000, SQLite stores an entire database — tables, indexes, views and triggers — in a single ordinary file on the filesystem. The application accesses the database through function calls to a C library linked directly into the process, with no sockets, no network protocols and no authentication layer.
The current version, SQLite 3, supports a broad subset of the SQL-92 standard: complex queries with JOINs, subqueries, GROUP BY, views and triggers are natively supported. The engine is designed to be compact — the entire compiled library is less than 250 KB.
Embedded architecture
SQLite’s architecture inverts the traditional relational database model. In a system like PostgreSQL or MySQL, the client sends queries over a network connection to a server process that manages storage, concurrency and transactions. In SQLite, all these components reside within the library itself, executed in the same address space as the application.
This model eliminates the latency costs of inter-process communication and radically simplifies deployment: distributing an application with SQLite means distributing a single executable file and a single database file. There is no service to configure, start or monitor.
ACID compliance
Despite the absence of a dedicated server, SQLite guarantees ACID compliance — Atomicity, Consistency, Isolation, Durability. Transactions are implemented through a journal file mechanism: before modifying the database, SQLite writes the original pages to a separate journal file. In the event of a crash, the journal is used to restore the database to a consistent state on restart.
The locking model is file-level: only one writer at a time can operate on the database, while readers can access it concurrently. This constraint makes SQLite unsuitable for scenarios with many concurrent writers, but perfectly adequate for single-user applications or those with low write concurrency.
Where SQLite is used
Portability and the absence of administration make SQLite suitable for a range of contexts that a traditional client-server database cannot serve. Embedded devices — phones, network appliances, measurement instruments — use SQLite as structured storage when resources do not permit running a separate server process.
Desktop applications adopt it to manage configuration, cache and local data. Web browsers use it internally for cookies, history and local storage. Testing frameworks employ it as an in-memory database to run tests without external dependencies.
SQLite has turned SQL into a file format. This is perhaps its most significant innovation: not an alternative to database servers, but an entirely new category of portable relational storage.
