Skip to main content
MDCMS stores all content, schema metadata, authentication state, and access control grants in PostgreSQL. This page documents the complete data model, the content lifecycle state machine, and the localization architecture.

Entity-Relationship Diagram

The following diagram shows all tables and their primary relationships.

Core Tables

The database schema is organized into four domains: authentication, authorization, project/environment management, and content.

Authentication

Authorization

Project and Environment

Content

Document Table Columns

The documents table is the central content table. Each row represents the current draft state of a single document.

Content Lifecycle

MDCMS uses a two-table model for content management. The documents table holds the mutable head (working copy), while documentVersions holds immutable publish snapshots. This separation enables draft editing without affecting published content.

State Machine

State Transitions

Published versions are never modified or deleted. The documentVersions table is append-only, providing a complete audit trail of every publication.

Concurrency Control

MDCMS uses optimistic concurrency via the draftRevision column. Every write request must include the current draftRevision value. The server atomically increments the revision on update and rejects any request whose revision does not match the current database value.
The Studio editor automatically handles revision tracking. If you are building a custom integration, always read the current draftRevision before writing and include it in update requests.

Localization Architecture

MDCMS implements localization through translation groups — a logical grouping of locale-specific document variants that represent the same content in different languages.

Translation Groups

The translationGroupId column links all locale variants of a document. When you create a translation, a new documents row is created with:
  • The same translationGroupId as the source document
  • A different locale value
  • Independent body, frontmatter, publishedVersion, and lifecycle state
Each translation is a fully independent document. Publishing the English variant does not affect the French variant. Deleting one translation does not delete others.

Default Locale

Content types that are not localized (no localized: true in the schema definition) use the sentinel locale value __mdcms_default__. This ensures a consistent data model regardless of whether a type supports multiple languages.

Locale Normalization

MDCMS normalizes all locale values to BCP 47 format (e.g., en-US, fr-FR, ja). The normalization is applied at write time, ensuring consistent locale handling across the API, CLI, and Studio.

CLI File Mapping

The CLI maps documents to filesystem paths based on locale:
The supportedLocales and defaultLocale fields in the Studio mount context control which locales appear in the locale picker and which locale is selected by default when creating new documents.