The Open Source Archive

Why SQLite is Public Domain

D. Richard Hipp's Radical Generosity

Glowing database file floating in digital void

In the spring of 2000, D. Richard Hipp was debugging software aboard the USS Oscar Austin, a guided-missile destroyer being built by Bath Iron Works for the U.S. Navy. His program depended on Informix, an enterprise database that required a database administrator to be running before it would function. When the server went down, so did his software. When the DBA wasn't around, nothing worked.

"I'll just write my own," he thought. A sentence that has preceded both disaster and brilliance in roughly equal measure throughout the history of software.

Hipp's frustration was specific: he needed a database that required zero configuration, zero administration, and zero server processes. Something that could run anywhere, including embedded systems with no administrator in sight. So over the next few months, he wrote SQLite. The name is literal: SQL Lite. A lightweight implementation of SQL that runs as a library linked directly into your program, storing everything in a single file on disk.

Twenty-five years later, SQLite runs on every smartphone on Earth. Every iPhone, every Android device. It runs in every web browser. It runs in every copy of Windows 10 and 11, every Mac, most Linux distributions. It runs in Airbus aircraft and in medical devices. There are likely more instances of SQLite running right now than any other software component ever written. Conservative estimates put the number at over one trillion active deployments.

And Hipp gave it all away. Not under the GPL, not under the MIT license, not under Apache or BSD. He placed SQLite in the public domain.

The Blessing

Most open source projects have licenses. The GPL requires sharing modifications. MIT and BSD require attribution. Apache has patent clauses. These are legal documents, written by lawyers, with terms and conditions.

SQLite has a blessing.

May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.

That's it. No copyright holder. No license compliance. No lawyers required. You can do anything you want with SQLite. You can modify it without sharing your changes. You can sell products containing it without attribution. You can fork it and close the fork. You can pretend you wrote it yourself, though Hipp notes dryly that this "is generally not recommended for career advancement."

Why public domain rather than a permissive open source license? Hipp's reasoning is pragmatic. International corporations have legal teams that must review any software license. The GPL is pages long. MIT is a paragraph. Even those require lawyers to evaluate. Public domain requires nothing. There is no license to comply with because there are no restrictions.

This creates an interesting legal wrinkle: some jurisdictions don't recognize the concept of voluntarily placing work in the public domain. If you can't give away copyright in your country, how can you use SQLite? The SQLite Consortium solved this by creating an alternative: for organizations that need a formal legal document, they offer a "SQLite License" for purchase. This license explicitly grants all the permissions that public domain status would provide, written in the kind of legalese that makes corporate lawyers comfortable.

92 Million Lines of Tests

The SQLite source code contains approximately 150,000 lines of C. The test suite contains over 92 million lines of code. That's a ratio of roughly 600 lines of tests for every line of production code.

This is not a typo.

SQLite achieves 100% branch test coverage. Not 80%. Not 95%. Every single branch in the code is exercised by at least one test. This includes error handling paths that can only be triggered by malloc failures or I/O errors. The test harness can inject failures at any of hundreds of points to verify correct behavior under conditions that would never occur in normal operation.

There are three separate test harnesses, each developed independently, cross-checking each other. There's a fuzz testing framework that generates millions of random inputs. There's SQL Logic Test, which runs millions of SQL statements and compares results across multiple database engines. There are proprietary test suites from aviation and medical device customers who require different safety certifications.

Hipp's philosophy here is straightforward: SQLite runs on aircraft. SQLite stores your messages and photos. SQLite manages financial records. The cost of a bug is not measured in customer complaints but in potential catastrophe. When your code might run on a billion devices, even a one-in-a-million bug means thousands of failures.

The Consortium Model

Here is the paradox of public domain software: if there are no restrictions on use, how does the creator make money? If anyone can take your work without paying, who will pay?

Hipp's answer is the SQLite Consortium. Companies pay $120,000 per year for membership. In return, they receive nothing that isn't also available for free. The same source code. The same documentation. The same mailing lists.

What they do receive is influence and insurance. Consortium members can suggest features and have them prioritized. They get direct access to the development team for support. Most importantly, their money ensures that SQLite continues to exist and be maintained. It's not a payment for software; it's a payment for continuity.

Current and former consortium members include Mozilla, Adobe, Bloomberg, Bentley Systems, and other companies whose products depend utterly on SQLite's reliability. For them, $120,000 per year is trivial compared to the cost of SQLite becoming unmaintained or the cost of building their own embedded database.

This is patronage economics. The wealthy institutions that benefit most from the commons pay to maintain it, not because they're legally obligated but because the alternative is worse. It works because SQLite is essential enough that someone must ensure its survival, and cheap enough that no single company minds bearing that cost.

Radical Simplicity

SQLite's design philosophy can be summarized in a single constraint: the entire database is stored in a single file. One file. No write-ahead logs in a separate location. No separate index files. No configuration directories. Just a .db file that you can copy, email, back up by copying to Dropbox.

This constraint drives everything else. Because the file must be self-contained, the format must be stable. SQLite guarantees that databases created today will be readable forever. Not "for the next major version" or "until we deprecate it." Forever. The file format is documented in the Library of Congress's recommended formats for long-term archival.

Because there's no server, there's no configuration. You link the library. You call sqlite3_open() with a filename. You're running a database. The barrier to entry is as low as any data storage mechanism can possibly be.

This simplicity is SQLite's competitive advantage against not just other databases but against alternatives like flat files or JSON. You want to store structured data? You could write a parser for CSV. You could manage JSON files. Or you could use SQLite and get ACID transactions, SQL queries, and proven reliability for roughly the same amount of code.

The Rule of St. Benedict

In 2018, SQLite adopted a Code of Conduct based on the Rule of St. Benedict, a sixth-century monastic rule. This was not a joke, though many assumed it was.

The Rule includes instructions like "First of all, love the Lord God with your whole heart, your whole soul, and your whole strength" and "Do not be jealous" and "Do not give way to anger." It was, predictably, controversial. Critics called it exclusionary, religious imposition, or simply weird.

Hipp's response was that the Rule describes how he personally tries to live and how he hopes the SQLite development community operates. It's not enforced; there's no conduct committee reviewing pull requests for insufficient humility. It's aspirational, a statement of values rather than a legal document.

In response to the controversy, the SQLite team added a "Code of Ethics" as an alternative, adapted from the Rule but with the explicitly Christian language removed. Both documents remain on the website. The incident reveals something about Hipp's approach: he does things his own way, often unconventionally, and lets the work speak for itself.

Serverless Before Serverless

Modern developers talk about "serverless" computing—cloud functions that run without visible infrastructure. SQLite embodied that idea two decades before the term existed, in the more literal sense: no server process at all.

This turns out to be prophetic. Edge computing, mobile applications, embedded systems, WebAssembly in browsers: all of these environments need data storage, and none of them want to manage a database server. SQLite runs everywhere because everywhere is its natural habitat.

There's sql.js, a port of SQLite to JavaScript via Emscripten, running databases in browsers. There's LiteStream, which continuously replicates SQLite databases to cloud storage. There's rqlite, which clusters multiple SQLite instances with Raft consensus. Each of these projects extends SQLite into territory its original design never contemplated, and each of them works because the foundation is so solid.

Public Domain as Strategy

Return to the blessing. Return to the choice of public domain over any kind of license.

Conventional open source wisdom says you need a license to protect your work. The GPL ensures derivatives stay open. MIT and BSD protect the author from liability. Apache handles patents. Without a license, what do you have?

You have friction reduction taken to its logical extreme.

SQLite is in your phone not because Apple and Google love open source but because their lawyers had nothing to review. It's in commercial products not because of developer advocacy but because there's no compliance burden. It spreads not through enthusiasm but through convenience.

The blessing acknowledges what public domain cannot enforce: ethics. You may do anything with SQLite, but Hipp hopes you'll do good. You may take freely, but he hopes you'll give back. The public domain removes legal obligations while the blessing suggests moral ones.

Whether this is naive or profound depends on your view of human nature. What's undeniable is that it worked. SQLite is ubiquitous not despite being public domain but partly because of it. Radical generosity turned out to be an effective distribution strategy.

Endurance

D. Richard Hipp still maintains SQLite. He wrote the first line in 2000 and he's still writing code in 2024. He attends conferences. He answers mailing list questions. He approves releases. The project has the continuity of a single guiding intelligence rather than the committee dynamics of most large open source projects.

This is both strength and vulnerability. Hipp's deep knowledge of every line of code makes SQLite meticulously maintained. His eventual absence will create a gap that's difficult to fill. The Consortium model provides funding but not succession planning.

For now, the battleship project that couldn't handle a missing DBA has become the database that's too simple to fail. SQLite doesn't go down because there's nothing to go down. It doesn't need administration because there's nothing to administer. It solved Hipp's original problem so completely that it became the solution for everyone else's problems too.

A trillion deployments, give or take. Zero configuration. Public domain. May you share freely, never taking more than you give.