On May 14, 2018, at 1:19 PM, Richard Hipp <d...@sqlite.org> wrote:
> 
> On 5/14/18, Warren Young <war...@etr-usa.com> wrote:
>> 
>> https://wiki.mozilla.org/Performance/Avoid_SQLite_In_Your_Next_Firefox_Feature
> 
> That's an older article.  These days, it is generally faster to use
> SQLite than fopen().  See, for example,
> https://www.sqlite.org/fasterthanfs.html

Your benchmark doesn’t address the primary problems pointed out in the Mozilla 
article:

1. Filesystem fragmentation.  Mozilla is talking about real-world pathologies, 
whereas if you run your paper’s benchmark on top of a modern filesystem, it 
won’t have much fragmentation, if any.  Mozilla’s point here is that if you 
rewrite the data file each time, it’s always in a defragmented state with 
modern filesystems.

2. DB fragmentation.  Your benchmark doesn’t simulate months of semi-random 
mixed DELETEs, INSERTs, UPDATEs, etc.  You don’t have to VACUUM a flat file 
loaded into RAM on app start and rewritten on app exit.

3. Stale data expiration policies.  When INSERT is all but free, you tend not 
to think as much about how much your data footprint is ballooning as when 
you’ve chosen a simpler persistence mechanism.

4. Journals have consequences, particularly on mobile platforms.  You don’t 
need to pay the cost for some applications.

5. “Just index it” doesn’t work when dealing with data that doesn’t index well, 
like a column of URLs, particularly on the modern web where you run into many 
arm-length pseudorandom URLs that you will only see once.

6. A naive reliance on SQLite’s good data structures breaks down when you 
misdesign your schema, indexes, etc. so that you create pathological behavior.  
All the indexing and log(n) and btrees in the world can’t help you when your 
simplistic query forces a table scan.

Understand, I’m not repeating the title of that article as unqualified advice.  
I offer it as contrast.  You can’t know whether SQLite is the correct answer 
unless you know what your alternatives are and how they respectively stack up.

The Mozilla article is reacting to the “If all you have is a hammer…” syndrome. 
 You can just as well flip it around: “If all you have is fopen(), you won’t 
know when you need SQLite.”  (Or PostgreSQL, or Hadoop, or…)

Very little of what this Mozilla article discusses is a result of old 
technology.  These are perennial topics.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to