[1+1=2]

OneAndOneIs2

« Getting into DrupalIs this a question? »

Tue, Feb 09, 2010

[Icon][Icon]Dude.. where's my bookmarks file?

• Post categories: Omni, FOSS, Technology, My Life

So following my last post on how Firefox has been annoying me by being buggy lately, I came across something I didn't know about FF version 3 that I thought was worth commenting on.

Because of a misbehaving extension, Tina lost all her bookmarks. In the hopes of restoring them, I took a look at her profile, and didn't see the expected plain-text bookmarks file. But I *did* discover a directory called "bookmarksbackup"

It turns out that FF saves backups of all bookmarks on a daily basis. About a week's worth. So you can always go into the bookmarks manager and restore your bookmarks from yesterday, or the day before, or the day before that..

And that was handy, and something worth knowing, and I was quite impressed, since that never used to be a feature - if you lost your bookmarks, you lost your bookmarks.

But what I found even *more* noteworthy was that, when I was looking for where Firefox stores bookmarks now, I found that it was stored in a file named places.sqlite

Yep.. as of version 3, they stopped using a plain-text file for bookmarks, and shunted them into a database instead. And not just bookmarks: Browser history, favicons, and even input history - when you type something into the awesomebar, it makes note of it for future use.

You might think it's a bit pointless, putting bookmarks into a database - who has THAT many bookmarks?? And I'd tend to agree if that were all they'd done.

But putting HISTORY into a database.. that I can understand. I keep quite a long history (90 days) and I visit quite a lot of websites. So there's a *lot* of data. And when you think about it, your browser needs to be able to check through your history *every time* it loads a web page: Many pages render links differently depending on whether or not you've visited them.

So a history database makes perfect sense: It can be big enough to justify it, and it needs to be FAST for a page to be loaded and displayed quickly.

And if you've got a database anyway, you might as well shunt as much stuff as you can into it. Like bookmarks.

Like so many things, this is one of those features that's completely invisible to the end user: I'm on version 3.5.7 and I only just discovered that FF has been using a database for history & bookmarks since 3.0.0 today.

But the combination of FF keeping bookmark backups; and the fact that it uses a database instead of plain text for all this stuff; I was impressed by. It's two very good ways of doing things, that probably took a lot of work on Mozilla's part and yet would have gone completely unnoticed by 99% of their users. So kudos to them for that. I'm impressed.

4 comments

Christophe
Comment from: Christophe [Visitor] · http://christophoronomicon.blogspot.com/
You didn't know Firefox had switched to SQLite for bookmarks since 3.0? That was actually somewhat of an unpopular decision, and debates for and against it were raging at that time across the web. People were saying that Firefox was doomed, and would lose integrity and stability by tying itself so close to a database. And indeed, for a while, until 3.5, Firefox suffered various performance issues that were all down to bugs in the SQLite implementation used. The worst were on Linux, where Firefox 3.0 up to 3.2 often froze completely for extended amounts of time because of the way the database interacted with the Ext3 filesystem. I know I suffered those slowdowns, and was not really happy about them.

But in any case, if it wasn't with a database, how else did you think AwesomeBar was implemented? The very goal of AwesomeBar was what obliged the Firefox team to start using a database rather than simple plain files. It just wasn't performing without one.

As for the backup system, it's true that it's kind of a secret thing. I discovered it when I started wondering why my .firefox folder was getting so big. You see, I have something like 1100 bookmarks (including the Live Bookmarks, since I use Firefox as a RSS reader too), so along with the history it makes the places.sqlite database quite big (about 12MB).

If you look further, you'll discover that Firefox nowadays puts nearly everything in databases. Saved passwords (in encrypted databases which are also backed up), cookies (!), download info (who's gonna search that?!) and form history. And extensions may have their own databases as well. All of it makes it very powerful, but sometimes I wonder if they didn't go *too* far.
09/02/10 @ 12:46
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
Well, no - FF3 came out in June 2008, which was when I went backpacking around Europe. Keeping up with tech news wasn't my highest priority!

As for the awesomebar - I didn't really think about it all that much, to be honest, but the amount of RAM Firefox has been using up in the last few years, I'd assumed it just loaded everything into memory on startup! :o)
09/02/10 @ 13:23
tuxdev
Comment from: tuxdev [Visitor]
The interesting thing that FF is using databases.. is that it now those databases need occasional maintenance. I run a little script that I got from github called "ffvacuum" to do that. FF is noticeably snappier for a while after a vacuum.
13/02/10 @ 06:47
Mike W
Comment from: Mike W [Visitor]
I just did some research on the FF ad-ons.

It seems that SQLite automatically re-indexes itself and FF V3.6 includes an automatic "vacuum" function!
13/02/10 @ 17:22

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
 

[Links][icon] My links

[Icon][Icon] Hmm.. new look for twitter? I hope it gets less "Ick! Change! Put it back!" nonsense than Facebook..
08/02/12

[Icon][Icon] Facebook Syndication Error
09/02/12

[Icon][Icon] I last listened to:
Johann Pachelbel - Canon in D major

[Icon][Icon] Most recent photo:
Submersible houseboat

[Icon][Icon]About Me

[Icon][Icon]About this blog

[Icon][Icon]My LQ profile

[Icon][Icon]My /. profile

[Icon][Icon]My Wishlist

[Icon]MyCommerce

[FSF Associate Member]


February 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        

Search

User tools

XML Feeds

eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by b2evolution free blog software