PDA

View Full Version : vb3 templates as Flat file


Inzagi
Thu 21st Feb '02, 5:06pm
Hi,
I really wish to have at least the option to save the templates in flat files. You could then chose between either having the templates in flat files or in the database like it is done in phpBB RC2 and in the Woltlab Board.

We would prefer having templates in files because a few thousend templates are really difficult to handle for the database (together with many other factors ..)

Also you could edit a single template easier and faster be having it directly on the server as html files ...

So any chance this will be regarded in vb3? And anythink that speeks against the possibility to have a either database or flat files based template system?

JamesUS
Thu 21st Feb '02, 5:13pm
I don't think that is going to happen I'm afraid - also flat files are significantly slower than database access for templates.

Each page in vBulletin uses a huge amount of templates, for example this page (showthread) uses 50 - 60 templates. 50 - 60 file calls is going to a) slow your board down a LOT, and b) get you in trouble with your host for causing high server load.

Database storage for templates is always the best option as there are not that many of them and databases are always a great deal faster than files. No database (no matter how busy) should have trouble coping with storing 500k of templates.

Also when you edit a template other things in the database need to be updated. So it would not be viable for people to be able to edit templates manually on your computer with a text editor. Also how would we handle for example style sets and the system we use now with custom and default templates.

Wayne Luke
Thu 21st Feb '02, 5:41pm
Originally posted by Inzagi
We would prefer having templates in files because a few thousend templates are really difficult to handle for the database (together with many other factors ..)

So any chance this will be regarded in vb3? And anythink that speeks against the possibility to have a either database or flat files based template system?

Well technically speaking performing 40 file reads to pull the front page or the forum display templates into memory is a lot of memory. This is about how many templates there are.

With our cached database system, this requires 1 query from the database to pull all the templates for every page so the I/O for each page is significantly less this way.

On your server, the maximum speed you can serve pages and the resources used are determined by the weakest point in the chain. In this case that point is the hard drive system. Even with ATA-100 and Ultra-160 drives, these will never be able to perform as fast as memory or the CPU. With a database you are applying an index so we don't have to search for each file...

Add to the fact that your templates inherit from a global set, this is also expanded to a large degree in 3.0. If you don't edit a template it is pulled from the global set. To maintain the functionality in the system now, each template set would have to be in its own directory and this would only increase the file reads. Of course there are ways to speed this up and the best way known to modern technology is to index the files through an RDBMS query system. Which we have done in utilizing MySQL for this.

Finally, to maintain the "Edit Anywhere" capability you have now with the templates, you would have to open your template directory up (CHMOD 777) to the world and increase your risks of getting hacked or close it down to everyone including yourself by changing the ownership to the Webserver user (CHOWN nobody).

Inzagi
Fri 22nd Feb '02, 5:51pm
alright... All in all this sounds very convincing.

Thank you for your your answers!