SQLite: The Database That Conquered Everything
How many databases are running on your devices right now?
Not PostgreSQL. Not MySQL. Not the databases your applications use.
SQLite.
Your phone has hundreds of SQLite databases. Your browser stores data in SQLite. Your desktop applications use SQLite. Your car’s infotainment system runs SQLite. Airplanes use SQLite for flight software.
SQLite is the most widely deployed database in history. There are more SQLite databases than there are humans.
What SQLite Is:
SQLite is an embedded SQL database engine:
| Feature | SQLite | Traditional RDBMS |
|---|---|---|
| Architecture | Library, in-process | Client-server |
| Configuration | Zero | Extensive |
| Administration | None | Required |
| Storage | Single file | Complex files/tablespaces |
| Concurrency | Limited (WAL helps) | High |
| ACID | Full | Full |
| Size | ~600KB library | Hundreds of MB |
You do not start SQLite. You do not configure SQLite. You do not administer SQLite.
You call sqlite3_open("data.db", &db) and you have a fully ACID-compliant relational database. No daemon. No port. No credentials.
The Numbers:
Conservative estimates suggest:
- 1+ trillion SQLite databases active worldwide
- Every smartphone ships with multiple SQLite databases
- Every web browser (Chrome, Firefox, Safari) uses SQLite
- Most desktop applications use SQLite for local storage
- Most embedded systems with data storage use SQLite
- Every iOS and Android app using Core Data or Room uses SQLite underneath
There are approximately 8 billion people on Earth. There are more SQLite databases.
The Creator:
D. Richard Hipp created SQLite in 2000 for a U.S. Navy destroyer program. The requirements:
- Work without a DBA
- Work without a network connection
- Work without external dependencies
- Just work
Hipp built SQLite, and then refused to sell it. SQLite is public domain. Not MIT. Not BSD. Not GPL. Public domain.
No license. No attribution required. No restrictions. You can do literally anything with SQLite code.
SQLite License:
"The author disclaims copyright to this source code."
That's it. That's the license.
Why Public Domain:
Hipp was asked why he chose public domain instead of a permissive license:
“I wanted to bless the world.”
SQLite has no corporate owner. SQLite has no governance board. SQLite has no license compatibility concerns. SQLite is a gift.
Try to use GPL code in proprietary software — lawyers appear. Try to use SQLite in proprietary software — nothing happens. It’s yours.
ACID Compliance:
SQLite is fully ACID compliant:
- Atomicity: Transactions complete fully or not at all
- Consistency: Database constraints are maintained
- Isolation: Concurrent transactions are isolated
- Durability: Committed data survives crashes
BEGIN TRANSACTION;
INSERT INTO accounts (id, balance) VALUES (1, 1000);
INSERT INTO accounts (id, balance) VALUES (2, 2000);
-- Power fails here? Neither insert happened.
COMMIT;
-- Power fails here? Both inserts are permanent.
A file-based database with full ACID semantics. In 600KB. With zero configuration.
WAL Mode:
SQLite’s Write-Ahead Logging mode improves concurrency:
PRAGMA journal_mode=WAL;
WAL allows:
- Multiple readers concurrent with one writer
- Faster writes (sequential, not random I/O)
- Crash recovery via the WAL file
Traditional SQLite rolls back journals on write. WAL appends changes and checkpoints later. WAL is why SQLite can handle more than you expect.
Where SQLite Runs:
| Platform | Usage |
|---|---|
| iOS | Core Data, app storage, system databases |
| Android | Room, SharedPreferences backend, system databases |
| Chrome | History, cookies, local storage, IndexedDB |
| Firefox | Places (history/bookmarks), cookies, storage |
| Safari | All local storage |
| Skype | Message history |
| iTunes | Library database |
| Dropbox | Sync state |
| Windows 10/11 | Multiple system databases |
| macOS | Spotlight index, Mail, Photos, everything |
| Airbus A350 | Flight management |
| Many cars | Infotainment, navigation |
SQLite’s test suite has 100% branch coverage. Not line coverage — branch coverage. Every possible branch in the code is tested. The test suite is larger than the SQLite source code.
Airplanes trust SQLite with flight data because the test suite is that thorough.
The Testing Philosophy:
SQLite has approximately:
- 600KB of library code
- 90,000+ test cases
- 100% MC/DC (Modified Condition/Decision Coverage)
- 2GB+ of test code and scripts
The test suite runs:
- Out-of-memory tests at every allocation point
- I/O error tests at every disk operation
- Crash recovery tests
- Corruption detection tests
- Malformed database tests
- Fuzz testing
This is not “good enough” testing. This is aerospace-grade testing for a database engine anyone can download for free.
What SQLite Cannot Do:
SQLite is not for:
- High write concurrency (use PostgreSQL)
- Multi-user server applications (use a client-server database)
- Terabyte-scale data (practical limit ~281 TB, but performance suffers earlier)
- Distributed systems (single file, single machine)
SQLite replaces fopen(), not Oracle. It is an application file format that happens to be SQL-queryable.
SQLite as Application File Format:
Instead of:
// Custom binary format
FILE *f = fopen("data.bin", "rb");
fread(&header, sizeof(header), 1, f);
// Parse custom format...
Use:
// SQLite as file format
sqlite3_open("data.sqlite", &db);
sqlite3_exec(db, "SELECT * FROM documents", callback, 0, 0);
// Full SQL power, indexing, transactions, corruption detection
Your “file format” gains:
- ACID transactions
- Indexing
- Full-text search
- JSON support
- Corruption detection
- Schema evolution
- Query optimization
Microsoft could have used SQLite for Office documents. They chose XML zips. They chose… poorly.
The Consortium:
SQLite development is funded by the SQLite Consortium. Members include:
- Adobe
- Apple
- Microsoft
- Mozilla
- Bloomberg
- Bentley
These corporations pay Hipp’s team to maintain SQLite. They do not control SQLite. They fund development. Hipp decides what ships.
One man’s vision, funded by corporations, owned by nobody, given to everyone.
The Lesson:
D. Richard Hipp built the most deployed database in history.
He released it to the public domain. He answers to no one. His test suite is aerospace-grade. His code runs in your phone, your browser, your car, and your airplane.
One file. Zero configuration. Full ACID. Everywhere.
PostgreSQL is for servers. SQLite is for everything else.
When choosing embedded data storage, there is no choice. There is only SQLite.
Hipp blessed the world. The world uses his blessing daily without knowing.
Now you know.
— Kim Jong Rails, Supreme Leader of the Republic of Derails