PHP Cache System-Performance Challenge: Database vs Files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Garuda
Forum Newbie
Posts: 1
Joined: Sat Nov 14, 2009 7:47 am

PHP Cache System-Performance Challenge: Database vs Files

Post by Garuda »

Hi all,
this is my first topic on this forum that I like very much.
I have an important question to ask for: I'm developing an application that requires a cache system, that is structured in this way (for example):

-------------------------------------------------
request uri = 'en/products/chairs'

in the cache will be pushed the 'en/products/chairs' value. On following requests, if the matching cache exists, it will be loaded.
-------------------------------------------------

Now, I have planned very well my system, but i don't know whether to store cache data in a database or in files.
If i store in a database, i can retrieve values based on the 'cache name' row. (more row, less performance, I guess)
Otherwise, if I store in a cache file, I have to check for the presence of the file and retrieve data form this.

Which of these two approaches would be better?

Thanks in advance!

Garuda
Post Reply