Member-only story
The most widely used database in the world
A piece of trivia
It would be an excellent question for a trivia show for programmers (by the way, I would definitely watch that!):
What is the world’s most widely used database?
- MySQL
- Oracle
- MongoDB
- Microsoft Access
- Something else
The answer is, of course, “something else”, namely SQLite. According to their homepage, there are over 1 trillion (1e12) SQLite databases in active use!
What is SQLite?
SQLite is a self-contained, serverless, zero-configuration, transactional SQL database engine. Let’s go over these characteristics one by one.
SQLite is stand-alone or self-contained in the sense that it has very few dependencies. It runs on any operating system and the entire SQLite library is encapsulated in a single source code file that requires no special facilities or tools to build. Similarly, a complete SQLite database is nothing more than a single file.
SQLite is serverless, because unlike most SQL database engines it is not implemented as a client-server process. With SQLite, the process that wants to access the database reads and writes directly from the database files on disk. There is no intermediary server process.
This also explains why SQLite is a zero-configuration database. It does not need to be installed before it is used, there is no setup, no need for an administrator to create a new database instance or assign access permissions to users. “SQLite just works”, as the homepage puts it.
Finally, it is a transactional database in which all operations appear to be atomic, consistent, isolated, and durable (ACID) — which are the most vital quality standards for databases. SQLite explicitly guarantees that changes within a single transaction either occur completely or not at all, even if the act of writing the change out to the disk is interrupted by a program crash, OS crash or even a power failure!
To boot, SQLite is public domain, small (about 600 KB), fast (SQLite can be faster than your filesystem), reliable, cross-platform, and offers a full-fledged flavour of…