A nice interview, though from 2007. One thing has changed a smidgeon: "he has a self-imposed limit on the size of his product: 250KB. And he's stuck to both aims". The FAQ on sqlite.org says "With all features enabled, the library size can be less than 500KiB ... If optional features are omitted, the size of the SQLite library can be reduced below 300KiB." Close though!
Using "gcc -Os -m32 -c sqlite3.c; size sqlite3.o" I get 443,264 bytes using the latest SQLite source on Ubuntu.
The "size" command gives a more accurate measurement of what actually ends up in a compiled and stripped binary. "ls -l" includes symbolic and linking info that gets stripped from the finished binary.
Thanks for the pointer to 'size'. I so rarely compile code these days. FWIW, on my Mac with 3100200, clang -Os -m32 is 495,508 bytes while gcc is 507,378.
Clang also has -Oz for even more aggressive size optimizations. I find that it is identical codegen to -Os half the time and shows some nice size reductions the other half of the time.
So how many SQLite databases are in use? "We don't have a good way of counting it," he says, "but we're guessing it's the most widely deployed SQL database in the world."
This article came out before the original iPhone was released -- it certainly is by now, probably by an order of magnitude.
Just "an order of magnitude"? I suspect you are off by an order of magnitude. If you count each deployed instance of each product using it, it's probably the most popular by close to 10 orders of magnitude.
Edit: phones are just the start. Numerous embedded products use it - the kind that ship in such large quantities that a couple pennies per device become significant sums of money. And even in the phone case, every app is using a separate database.
That's probably excessive by a lot, but every modern smartphone has at least one sqlite bundled (possibly more, some software will bundle their own in case the system changes its version), OSX bundles it (and Apple Mail uses it for some stuff), Chrome and Firefox bundle it, …
Hacker news is too often obsessed with get rich quick schemes, and devising new ways to rip people off. It's nice to hear a story about people who just wants to write good, useful software, and release it to the public domain.
> The author disclaims copyright to this source code. In place of a legal notice, here is 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.
Wow! That is the most enlightened disclaimer I've ever read.
27 comments
[ 1.5 ms ] story [ 84.8 ms ] threadThe "size" command gives a more accurate measurement of what actually ends up in a compiled and stripped binary. "ls -l" includes symbolic and linking info that gets stripped from the finished binary.
There was another one earlier today: https://news.ycombinator.com/item?id=11048637.
[0] Internet Archive https://archive.org/
This article came out before the original iPhone was released -- it certainly is by now, probably by an order of magnitude.
Edit: phones are just the start. Numerous embedded products use it - the kind that ship in such large quantities that a couple pennies per device become significant sums of money. And even in the phone case, every app is using a separate database.
Wow! That is the most enlightened disclaimer I've ever read.