Proposal: Encouraging DB-using applications

Roberto Alsina ralsina at kde.org
Sun Sep 21 19:48:10 BST 2003


> On Sunday 21 September 2003 10:11, Roberto Alsina wrote:
>>
>> Examples of applications where a DB makes sense:
>>
>> Recipe app (KRecipes)
>> Mail/News client (why not?, it makes "search folders" way simpler)
>> CD/Book/Whatever catalog
>> Notetaking applications (KJots, KNotes)
>> RSS aggregator (try handling 300 feeds in a flat file :-)
>
> And here we disagree. None of these apps would benefit from using a DB,
> and
> all are the perfect example of using a tool way too powerful and complex
> for
> the job. Email has the additional requirement that it *must* be in a
> format
> easy to recover.

I can only give details about the app I did write:

If you have 300 feeds in a RSS aggregator, you usually get about 600 new
items a day. If you keep two months worth (some people want to keep more),
that is 36K items.

The average item is 500bytes. So, the base is not very big. But the
searches are complex.

What item trackbacks to what other? What items come from the same source,
or the same day. You can "display latest items" or "items for that day",
or many other combinations. Really, I think I have about 35 different SQL
queries, none terribly hard, but I have no idea how to do them using a
flat file.

>> Yes, all of these can be implememnted by grepping a few text files.
>> But
>>
>> a) That doesn't scale
>
> It scales more than enough for the amount of data a typical user will ever
> have to handle.

The KRecipers author mentioned that often people have thousands of
recipes. He was complaining that a relational DB was too slow,
imagine a flat file :-)

>> b) That's ugly ;-)
>
> Who cares,

I do, of course.

> we need something which works, is easy to maintain and
> reliable.

SQlite is pretty reliable. Besides, saving a daily dump is trivial.
It requires no maintenance, because it's an embedded database. It uses
plain old files, just not plain text ones.

>> c) That's actually harder!
>
> Come on. It can become harder if you actually have fairly complex queries
> to
> do. In most cases, it won't.

In some cases, it will. But sure, there are cases when a DB is not
necessary. I can tell you, trying to write a serious RSS aggregator
without one is much more difficult.

>> Please ask your VB-programming friends if having a semi-decent DB
>> available doesn't help writing apps.
>
> I don't have any VB-programming friends.

I do. They love their DB support ;-)

> I do have friends using DBs, and
> they
> would all tell you exactly the same thing : DBs don't apply in these
> cases.

They are probably DB managers, or somesuch? We are talking embedded
DBs, it's not the same thing.

> Note that by "DB" I mean a relational DB. Even if you make something like
> MySQL or Postgres lighter, it will still be overkill in most cases. I
> suppose
> BerkeleyDB is acceptable, although in terms of reliability it doesn't seem
> to
> have a very good track record.

BerkeleyDB is hardly more functional than a flat file. I doubt using BDB
gains much, except faster access time.

-- 
 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  ralsina at kde.org
 (_Y_.)' ._   ) `._`.  " -.-'   KDE Developer (MFCH)
  _..`-'_..-_/ /-'_.'
(l)-'' ((i).' ((!.'             Buenos Aires - Argentina
Imminentizing the eschaton since 1971.




More information about the kde-core-devel mailing list