What are database-driven websites?

Please note: I have shifted my focus to Python/ Linux/ embedded development and am no longer accepting MODX or PHP projects. For MODX work, I recommend Grey Sky Media.

A database-driven website is basically just a website being put together from parts stored in a database. Most popular content management systems use a database, including Drupal, Wordpress, and MODx.

For a simple example, you might have the following pieces of your website kept separately:

  • The header for the entire site (with your logo and main menu)
  • The title of each page
  • The main content of each page
  • The footer for the entire site (with copyright information and links to policy pages)

When your About Us page is visited, an entire HTML webpage is pulled together:

Header + About Us Title + About Us Content + Footer

The same thing happens with the Contact Us page:

Header + Contact Us Title + Contact Us Content + Footer

Modular Design

The main advantage of keeping website pieces stored separately in a database is a Modular Design.

To sum it up, you pick and choose the elements that go inside every page. In the above example, the header and footer was re-used for every page, while a title and content specific to the page was inserted in only for that page.

The real gains start happening when you get more and more elements to build with. One page might have a header, main menu, and footer that is shared with the entire site, content and title specific to the page, a comments form that is only used on article pages, a sub-menu specific to the page category, etc.... 

Avoid Repetition, Reduce Work

Using a modular design almost always results in less work. By keeping repeating elements separated, you are able to re-use them without having to re-write them. 

Organization

Database-powered websites also have the advantage of organization.

By keeping your content separate from your design, creating new pages, editing, and organizing the site tree become much simpler. You avoid all of the clutter that comes with static webpages, such as menus, javascript, and other repeating HTML elements.

MODx, for instance, keeps everything separate: page-specific content, variables, repeating HTML, templates (page structure and appearance), PHP code, modules, and more. This allows for a well-organized, easily expanded, modular web page with everything from galleries to user accounts.