Live data from Hacker News

SQLite is likely used more than all other database engines combined

sqlite.org

31–40 of 82 posts

Re: SQLite is likely used more than all other database engines combined

#31
post #10

I’m curious, is the prevalence of SQLite similar to how PHP is widely used because it’s behind many WordPress sites?

It's also the default database used when creating new projects using many web frameworks, like Rails or (IIRC) Django.

Re: SQLite is likely used more than all other database engines combined

#32

For niche uses of database I am sure this is true. But if you are not in that niche, then Postgresql is usually a much better choice. For example Firefox uses SQLite, because it wants to store lots of application specific data. It is good for that. Personally, I find the tooling, documentation, familiarity and quality of Postgresql makes it my choice even in situations where SQLite might work.

At some point, such local usages were sufficiently non-niche that the temp file extension was changed from "sqlite" to "etilqs" to stem the flood of angry emails about local application databases taking up too much disk space. (cf. Daniel Stenberg getting angry emails because everybody and their dog embeds libcurl, sometimes multiple times in the same app)

Here's the commit from 18 years ago explaining that change: https://github.com/sqlite/sqlite/commit/fd288f3549a1ab9a309a...

    ** 2006-10-31:  The default prefix used to be "sqlite_".  But then
    ** Mcafee started using SQLite in their anti-virus product and it
    ** started putting files with the "sqlite" name in the c:/temp folder.
    ** This annoyed many windows users.  Those users would then do a 
    ** Google search for "sqlite", find the telephone numbers of the
    ** developers and call to wake them up at night and complain.
    ** For this reason, the default name prefix is changed to be "sqlite" 
    ** spelled backwards.  So the temp files are still identified, but
    ** anybody smart enough to figure out the code is also likely smart
    ** enough to know that calling the developer will not help get rid
    ** of the file.

Re: SQLite is likely used more than all other database engines combined

#33
post #7

In terms of installations, sure. In terms of total data, probably not. In terms of important data, 100% not. Important data needs guarantees, and its privacy is second to its longevity. Server side and centralized beats client side decentralized for all but sensitive consumer data.

You may be shocked to learn how much of the world's "important data" lives in Excel files.

Re: SQLite is likely used more than all other database engines combined

#34
post #10

I’m curious, is the prevalence of SQLite similar to how PHP is widely used because it’s behind many WordPress sites?

I think Sqlite's accessibility and ease of use definitely help. However, the fact you can distribute an entire db with a single file is something that shouldn't be overlooked, nor sqlite's legendary reliability and insane test coverage. Finally the fact you can embed it in memory makes for an amazing testing story.

Re: SQLite is likely used more than all other database engines combined

#35

For niche uses of database I am sure this is true. But if you are not in that niche, then Postgresql is usually a much better choice. For example Firefox uses SQLite, because it wants to store lots of application specific data. It is good for that. Personally, I find the tooling, documentation, familiarity and quality of Postgresql makes it my choice even in situations where SQLite might work.

The most frequent use of it is local storage of application data. Postgres is overkill for that.

Re: SQLite is likely used more than all other database engines combined

#36

For niche uses of database I am sure this is true. But if you are not in that niche, then Postgresql is usually a much better choice. For example Firefox uses SQLite, because it wants to store lots of application specific data. It is good for that. Personally, I find the tooling, documentation, familiarity and quality of Postgresql makes it my choice even in situations where SQLite might work.

If I'm not mistaken, Apple's CoreStorage is based on SQLite, so pretty much every Apple device for the last years (or decade, probably) is constantly using tens (or more) SQLite databases, per OS. That includes Macs, Phones, Watches, AppleTV etc. That has got to be more than 3 billion devices (since there are at least 2 billion of the phones in active use).

SQLite is also quite often a CI/CD default when building and testing software where you might want to do some tests without starting an entire RDBMS server.

But I suppose it's different if we think in terms of networked databases, or multiuser.

Re: SQLite is likely used more than all other database engines combined

#37
post #9

Earlier quoted context omitted.

It's still OSS, you're allowed to fork and maintain Sqlite if you don't like the upstream merge requirements.

The test suite is (partially) proprietary. Good luck maintaining a fork for a DB without tests. https://www.sqlite.org/th3.html see bottom

You can buy a license, and maintain your public fork while also letting everyone know you validated your fork with the same TH3 as the origin version. You just won't be able to show people your TH3 since I doubt you can buy a license that allows that.

Re: SQLite is likely used more than all other database engines combined

#38

I wonder what happened to bdb. I guess maybe authors lost interest/sold to Oracle and the license changed development just didn't keep up with the times. Bdb used to be the sqlite before sqlite existed and ended up used by various embedded applications or even graphical interfaces e.g. to index file thumbnails and such. I'm not sure but I think MacOS at one point used it this way.

I haven't even thought of Berkeley DB in years. Used to use it quite a bit but most notably perhaps with apache mod_auth_db to handle authentication and subscriber information on a fairly high traffic site (yes, this was long long ago ;) ).

Re: SQLite is likely used more than all other database engines combined

#39
post #7

In terms of installations, sure. In terms of total data, probably not. In terms of important data, 100% not. Important data needs guarantees, and its privacy is second to its longevity. Server side and centralized beats client side decentralized for all but sensitive consumer data.

I'm not sure I buy the "important data" one: my Lightroom catalog, to me , constitutes incredibly important data. Losing it and just having the base files would destroy over a decade of work. It also happens to be a SQLlite3 database. And the same is true for a slew of other applications that (quite rightly) use SQLite databases as their file format. You might be thinking of things like financial transactions, or med…

The number of societal-wide problems that occur if your Lightroom database gets corrupted is zero.

The amount of hell that would be unleashed if the financial systems layers upon layers of database transactions got broken is impossible to comprehend.

So if you mean “important” as “necessary for society to function”, then no, your browser bookmark files, contact list, or the other two dozen things your laptop and phone use SQLite for are not important.

Re: SQLite is likely used more than all other database engines combined

#40
post #7

In terms of installations, sure. In terms of total data, probably not. In terms of important data, 100% not. Important data needs guarantees, and its privacy is second to its longevity. Server side and centralized beats client side decentralized for all but sensitive consumer data.

Would you classify a nurse call system as requiring important data retention and access? Mapping backbone devices with passive and interactive end user devices with means to communicate whom should provide assistance?

Works great there too with μC/OS-II. Competition was using Windows XP and Microsoft Access.

Only time ever using Oracle has been with internal business analytics, not very important.

Post reply on HN