View Full Version : Content Management with MySQL

02-01-2010, 03:03 PM
I'm doing a site and my client wants to have the ability to change the content of the different sections of the website.

There's more than one way to do this, but I think the way that would be easiest for them (because they don't have web design experience) would be to just have the unique content of each page stored in a database. They can pull it up in their control panel and edit it, and when you visit the webpage it would just pull the info out of the database. It makes more sense than giving them a directory of files and giving them an interface to edit all the HTML and PHP code (which also means they could potentially destroy the site).

It's easy enough have each page grab its contents from the database, I'm just worried about load times and bandwith. Does any of this stuff get cached, or would we have to take a trip into the database every time we load every single page? If so, is it fairly negligible?

02-01-2010, 04:21 PM
This is what the big content management systems do. The difference is that they tend to provide a WYSIWYG editor for content creation (see TinyMCE and CKEditor, for example). You really don't want to make site files available to your client - they will break the site and screw up everything they touch. If you insist on building your own CMS, give them a user interface for content creation.

Regarding the db storage, the performance will depend upon the host. I've used Drupal on Dreamhost. Don't make that mistake - their database servers are painfully slow, and if you get more than one site hitting the database at the same, the requests may time out. Miserable performance. There are other hosts that will provide a respectable db experience, unless you're skimping on price.

Caching is up to you. If you build it in, it can save load times. Otherwise, you'll hit the database fresh each time. This is something else that is included in the big CMS projects.

02-01-2010, 11:09 PM
If the content is fairly static, making it dynamic, (i.e: not caching it), would be pointless. No use connecting to the DB unless necessary, and you can easily update the cached version when the master copy in the DB is edited/updated.

02-02-2010, 01:28 AM
Drupal or Wordpress would be my personal choice for this, depending on just how big and fancy the site is. Both have caching addons available to help performance and response times