tags:

views:

91

answers:

1

Hi, I just wonder what is best practice to store template files? In CMS I have using templates and some of parameters are stored in database... But there are some issues then i need to change something in templates or change one of parameter in many pages. Site has 100K unique visits every day... and I don't really want to make experiments with site. Just whant to know what is best for performance, to store templates and parameters in database or in file?

+2  A: 

Database access will on the whole be quicker (for many concurrent reads) than disks (unless highly mirrored). And it is more scalable but this depends on configuration making this highly subjective.

extended

Because your files will be quite small, memcache+SQL backend is still better than JBOD or sync of directories between nodes. Unless you want a SAN/NAS but that will work out more expensive if you just want to serve a bunch of small text segments. This is based on the fact you are probably already using an RDBMS of some kind.

Really, it depends on too many factors to go into.

Aiden Bell
forgot to mention that most used files are stored in server memory
Irmantas
memcache+SQL backend is still more sophisticated then JBOD. Unless you use a SAN ... which is probably more costly :P
Aiden Bell
If your template files are in PHP and stored on disk, you can automatically cache the compiled bytecode with APC, whereas if your PHP-based template files are in the database, and eval()'d each time, you're suffering a compilation for each request. APC will outperform the database.
Frank Farmer