Succeed in Web Design

Database-Driven Websites

A database-driven website — also called a dynamic website — builds its pages from information stored in a database, instead of serving fixed files that never change on their own. This lets large or frequently updated sites manage their content efficiently.

Questions you may have include:

  • What is a database-driven website?
  • How does it differ from a static site?
  • When do you need one?

Static versus dynamic

A static site is a set of fixed pages; to change one, you edit the file. A dynamic, database-driven site stores its content as data and assembles each page when it is requested. The same page template can display thousands of different items by pulling each one from the database.

How it works

When a visitor requests a page, a program on the web server retrieves the needed information from the database — often using SQL — inserts it into a template, and sends the finished page to the browser. The structure stays the same while the content changes.

When you need one

Database-driven design suits sites with a lot of content or content that changes often: online stores, news and reference sites, directories, and anything personalized for the visitor. Most content management systems, including WordPress, are database-driven, which is what lets non-programmers add and edit content easily.

Summary

A database-driven website generates pages from stored data rather than fixed files, assembling each page from a template and database content when it is requested. This approach scales to large, frequently changing, or personalized sites, and it underlies common content management systems.