'Lite' Databases (Re: sqlite3 and dates)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Feb 18 21:13:08 EST 2015


Chris Angelico wrote:

>> SQLite misses some important features that makes it better suited as a
>> simple datastore, not much unlike shelve. And network use is not one
>> of them, since you can actually implement concurrent sqlite access by
>> coding an intermediate layer. Assuming of course we are talking about
>> a small number of concurrent users.
> 
> This is what I was saying: it's fine for purposes like Firefox's
> bookmarks and settings and such (which I think was what it was
> originally developed for?). Not so fine over a network.

The sheer number of Firefox bugs related to its use of SQLite says 
different.

Once upon a time, Firefox's config, bookmarks, etc. were stored in plain 
text files. At worst they were HTML. You could trivially read them, copy 
them, restore them and even (if you were careful) edit them using the text 
editor of your choice. Many a time I was on one machine, wanted to know a 
bookmark from another machine, so I would ssh across to the other machine 
and run grep over the bookmark file.

No more. Firefox still keeps a bookmark HTML file, but it never seems to be 
synced with the actual bookmarks. Settings are stored in an opaque blob, 
rather than human-readable text, limiting what you can do with it. It's very 
nice that Firefox offers about:config but not so nice that you can't do the 
same thing without the GUI running.

If Firefox crashes, there are failure modes where it can no longer read your 
bookmarks, or keep history. I don't mean that history won't persist across 
restarts, I mean that *within a single session* it cannot remember what page 
you came from so you can hit the Back button and return to it. WTF? 

I swear, if not for the fact that every single other browser is worse, I 
would dump Firefox in a second.

I don't believe for a second that moving to SQlite has anything to do with 
performance, because reading and writing preference settings should be rare 
and far from a bottleneck. SQlite is simply fragile and unreliable over a 
network, and people using their home directory on a network drive are not 
that rare.


-- 
Steve




More information about the Python-list mailing list