Note: EXT4 is terrible with transactions. There are ways to tweak it though, and ways to tweak the database to not sync after EVERY SINGLE BLOODY INSERT!
Performance at the cost of data loss? No, thanks.
Originally Posted by droidhacker
Well, I am fully aware that several desktop apps use database programs internally, and that firefox uses sqlite. Hence I categorically asked if so such great speed is required for desktop purposes. (Hint: Desktop search and antivirus.)
Originally Posted by Ranguvar
And speaking of obsession with database usage in applications, here is an anecdote. Why is that amarok must need mysql? On Gentoo (which is by and large close-to-upstream without much distro customization), I start amarok and the first thing it shows me is an ugly error that mysql is not running and I need to setup a password and database, all for listening to music. I have only a few hundred music files and I wish there was a USE flag to turn mysql off, instead using a simpler or no backend.
The next thing we know is Oracle launching a new browser, that uses its flagship database running on zfs/btrfs to manage your bookmarks, cache, cookies, mail and other kstuff, never mind its bog slow at rendering. </sarcasm>
Yeah, using a full-fledged database server like mysql for a desktop app is kind of overkill. That's why embedded databases like sqlite are so popular these days - the power of an SQL engine for doing queries, while running entirely in-process.
Originally Posted by hdas
Hence why at least Fedora ships Amarok with mysql-embedded (which does not run as a separate service) instead of full-blown mysql.
Originally Posted by Delgarde
But it's safer then writeback and faster then journal.
Originally Posted by nanonyme
But due to Ext4 extensive caching it's pretty haphazard if you're doing something where your system might hardlock like eg testing drivers nowadays...
Originally Posted by kraftman
The comparison is between the filesystems and the way they are treated by the database.
Originally Posted by BlackStar
ext4 vs UFS.
UFS is a lot closer to ext2 than ext4.
And in the same database tests where UFS made it win, ext2 would also destroy ext4.
Which makes the whole test irrelevant.
You can make ext4 fast, and yes, at the cost of POTENTIAL data loss (not guaranteed data loss), and DOING SO will NOT make your data loss any MORE likely than by using the faster filesystem, in this case UFS.
In fact, your data is probably still safer on ext4 than UFS, even if you adjust ext4 to be as fast as UFS.
Alternatively, reduce the rate that the database calls sync. Instead of after EVERY transaction, limit it to once every 5 seconds. Data loss? Maximum of 5 seconds, but still wickedly fast.
Then, of course, comes the major important point -- what are you doing with sqlite that is so important that you can't afford to lose a few seconds of data? If the absolutely last second of data is so important that you can't lose it, I STRONGLY suggest that you switch to a proper database.
Honestly I wish more applications would use some other embedded SQL solution other than SQLite.
Originally Posted by nanonyme
If your SQLite database grows beyond a certain point, your performance will be horrid and the only option at that point is to use something else. Embedded MySQL doesn't have those kinds of scalability issues (Well, at least the point where it doesn't scale is quite a bit higher).
Also should your application want to switch over to a full on SQL server, the application largely just needs to change how it connects or opens the database and it can go from there. It's easy migration without the SQL dialect/quirk game.
PostgreSQL has an embedded option too.
Sure MySQL or PostgreSQL may have a larger memory footprint but it's shared between applications. Heck, if you're running KDE, akondi probably already has a copy of MySQL running for you. IMO, 25MB isn't a horrible amount of RAM for your typical desktop system. What's that... a browser tab worth of memory?
Tags for this Thread