SQLite, a serverless single-file database built by one engineer, became the most deployed software component in history.
The narrator cites about 5 million MySQL installations and roughly 1 million PostgreSQL installations worldwide, against over 1 trillion active SQLite deployments. It runs in every iPhone, Android, browser, Mac and Windows machine, in apps like WhatsApp, Chrome and Safari, and there are now more SQLite databases on earth than human beings.
In 2000 Richard Hipp was building damage-control software for the Navy destroyer USS Oscar Austin. It used Informix, which needed a server; when the server went down the app crashed. A serverless database did not exist, so during a government funding pause he wrote one from scratch, with no VC funding and no team.
PostgreSQL runs as a separate server process your application connects to over the network, which must be configured, secured and tuned. SQLite has no server, network connection or separate process: it is a library linked into your application that reads and writes a single file on disk, and that file is the database.
The file is divided into fixed-size pages, 4096 bytes by default, matching a typical disk block. The first page holds a 100-byte header with the page size, page count, version number and the magic string 'SQLite format 3'. Every other page is part of a B-tree holding table rows or index entries.
It uses B-trees. A query for id 42 starts at the root, compares keys and follows child nodes to the leaf page holding the row, in logarithmic time, so millions of rows may need only 3-4 page reads. Separate index B-trees, for example on email, map keys to row IDs.
Originally it copied pages to a rollback journal before changing them. Modern SQLite uses write-ahead logging: changes are appended to a separate WAL file and merged back at checkpoints. Readers and writers don't block each other, writes are sequential, and uncommitted WAL entries are ignored after a crash, so the main file stays consistent.
After Android exposed bugs, Richard Hipp spent a year of 60-hour weeks reaching 100% MC/DC coverage, the avionics standard. Today about 160,000 lines of C are backed by about 90 million lines of tests, roughly 600 to one, simulating out-of-memory errors, disk failures and power loss. SQLite is certified under DO-178B.
Two. The narrator says two full-time engineers maintain the most deployed database in history, which is implemented in about 150,000 to 160,000 lines of C rather than the millions used by systems like PostgreSQL, MySQL and Oracle, and compiles down to an engine of about 300 kilobytes.