Skip to content

SQL databases as documentation repositories

In a CMS like Drupal, Joomla, or WordPress, technical content lives in an SQL database that keeps only per-article history and cannot search and replace across all content - one reason to manage it as text files instead.

, 1 min read

View as Markdown

In the case of a CMS (Content Management System)A tool that adds workflow and file-locking to content management, at the cost of reliability trade-offs compared to plain version control.View in glossary → (CMS) such as Drupal, Joomla, or WordPress, the RepositoryThe place where a documentation team keeps its sources: shared folders, a CMS database, or a version-control system such as Git, which also stores the complete history of every file.View in glossary → is an SQL database. It maintains a history on a per-article basis, but does not support text search and replacement across all content.

This may justify choosing to manage the underlying content of the CMS in the form of text files. Static site generators work this way: content lives as text files in a Git repository, the published site is a build product, and search-and-replace across all content is an ordinary operation on files.

A database can still be the right source of data for documentation, for example product names and versions, as long as the text itself stays in files. For an example of querying an SQL database to populate documentation automatically, see automatically insert SQL data into a reStructuredText file.