Re: files or DataBase

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "tomcask o_o" <tomcask(at)gmail(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: files or DataBase
Date: 2006-09-29 02:12:16
Message-ID: 71E37EF6B7DCC1499CEA0316A256832802B3E654@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

As Jim N. already pointed out, extra layers do have a cost in time, and for some things straight disk is way faster.

A few points to consider (you don't give enough details for me to tell if this is true for you or not) ...

a) ACID -- what databases do best, making sure that everything that was changed is changed uniformly, etc. This can be hard to manage in a file system, although its not impossible, depending on what you are doing.

b) how much traffic ? With small datasets most requests will find an already cached file and won't have to go to disk; this is true of databases as well If, OTH, you have either lots of requests for data that is rarely seen, or you have more data than can be cached, disk becomes a bigger issue.

c) Indexing and searching can be faster in a database (especially for complicated data sets) -- that's the payoff for the overhead of extra disk space for the indexes. Simple schemas can be implemented easily enough on a file system but rapidly become unworkable if you have data that needs to be addressed different ways (e.g. by name, and by date, etc.)

d) Update frequency -- databases do a better jopb of making sure that everyone sees a consistant selection; update a database with 10,000 items in a transaction, and everyone outside the transaction sees the old 10,000 items as a consistant whole; the transaction commits and instantly everyone will see the new 10,000. With a file system it can be hard to do this (although, again, there are ways). The more volatile the data the more I'd lean toward a database, personally. But again, without details of what you want to do it is very hard to say much other than generalities.

HTH,

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org on behalf of tomcask o_o
Sent: Thu 9/28/2006 3:37 PM
To: pgsql-sql(at)postgresql(dot)org
Cc:
Subject: [SQL] files or DataBase

Hi

in advance, sorry for my english.

in a Web server as is the best option?

to accede to db to show the contents or to accede to static files modified
by scripts when the content of db has been modified.

That the habitual thing is to work directly with db and to give back to the
results mounting the page then.

But I believe that serious much more fast if they were directly the files
and on the other hand in the server of local way executed scripts whom the
changes of the files in a aux table verified, and published the files that
have undergone changes.

that to both consider the yield of the server in the diferents scenes.

Greetings and thanks.

-------------------------------------------------------
Click link below if it is SPAM gsw(at)globexplorer(dot)com
"https://mailscanner.globexplorer.com/dspam/dspam.cgi?signatureID=451c4dbb67491336712104&user=gsw(at)globexplorer(dot)com&retrain=spam&template=history&history_page=1"
!DSPAM:451c4dbb67491336712104!
-------------------------------------------------------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message chester c young 2006-09-29 21:31:12 regexp_replace usage
Previous Message Jim C. Nasby 2006-09-29 01:06:13 Re: files or DataBase