You are here: Re: DB -> Flat file, did I waste my time? « PHP Programming Language « IT news, forums, messages
Re: DB -> Flat file, did I waste my time?

Posted by Christoph Burschka on 01/24/07 07:26

FFMG schrieb:
> In my site I have a config table, (MySQL), with about 30 entries; the
> data is loaded on every single page load. This is not the only call to
> the db, (we do a total of about 8 calls to the db).
> As with many configurations settings, once the options are set the
> values will not change much.
>
> So I thought it would be a good idea to move the data to a flat file.
> I have written a small wrapper class to first look for the file, if it
> exists then load the data from that file, if not the data is loaded
> from the database and then saved to a file.
> That way I can copy the database without worries about the cached data
> itself.
>
> It all works as expected, but the question is, did I waste my time?
> How can I do some load test on my server to see what would be better?
> Database call or flat file read.
>
> My personal guess is that the flat file will only help under very heavy
> load, (a couple of hundreds/thousand pages a seconds).
>
> What do you think?
> Will the flat file help at all?
>
> Simon
>
I would guess that the relational database is better for a great amount
of data that needs to be sorted and changed regularly. The flat file is
better for a small amount of data that gets read extremely often, always
in the same order, but never written.

Almost all PHP/MySQL CMS (eg Drupal and MediaWiki) have their basic
configuration settings in a file - so it probably isn't a bad idea.

--
CB

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация