SQLite is the most widely deployed database in the world, running on devices as ubiquitous as phones and TVs and as mission-critical as aircraft software. But how did it get there, and where is it going next?
I love this paper because it gives both a historical perspective on SQLite and an honest look at its advantages and shortcomings. SQLite originated 25 years ago as a small package of data management functions for Tcl, but rapidly evolved into a full-fledged transactional database. It became enormously popular for three big reasons:
- It’s embedded and self-contained. Uniquely among major databases, SQLite runs inside your application's process instead of on a separate server. It’s distributed as a single C file that compiles to less than 750 KiB. This lets SQLite run in resource-constrained environments where a conventional database would be unworkable.
- It’s cross-platform. A SQLite database is stored in a single file that can be freely copied across almost any machine, regardless of architecture. In embedded systems where custom architectures are everywhere, this is a huge advantage.
- It’s reliable. SQLite has a stunning 600 lines of test code for every line of SQLite code, covering all sorts of rare crashes and failure conditions. This is huge for mission-critical systems.
What’s interesting about SQLite is that while it was designed for transactional workloads, it’s increasingly used for analytical (OLAP) workloads just because it’s lightweight and easy to add to a data science library. Smart database researchers saw this trend and built an embedded analytics-focused database, DuckDB , which has also become very popular. A big chunk of the paper is devoted to a performance comparison of the two, and the differences are striking:
- On transactional workloads containing mostly small reads and writes, SQLite is 10-60x faster than DuckDB.
- On analytical workloads consisting of large scans, aggregations, and joins, DuckDB is 30-50x faster than SQLite.
This shows how important it is to pick the right system for your workload! Interestingly, the authors propose some optimizations for SQLite based on ideas from DuckDB, like using Bloom filters to speed up big joins. These make SQLite up to 4x faster on some analytical queries, though it’s still an order of magnitude behind DuckDB. Hopefully cross-pollination between databases continues to improve them all in the future!
$34 million, or 11,539 eth, is permanently locked into the AkuDreams contract forever. It cannot be retrieved by individual users or by the dev team.
The refund processing, which is complete, sets each bid status to 1.