PHP Cache System-Performance Challenge: Database vs Files
Posted: Sat Nov 14, 2009 7:56 am
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
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