The Headless Architecture Pattern Beyond CMS
What is headless architecture?
Headless architecture is a design in which the backend that owns the data (the body) has no built-in presentation layer (the head). It exposes its data through an API, usually REST or GraphQL, and every interface that needs the data is a separate client of that API.
The name comes from content management. A traditional CMS such as classic WordPress or Drupal stores content and renders the pages from it in one application. A headless CMS keeps the storage, the editing interface and the workflow, and drops the rendering: it publishes content as structured data, and a separate frontend decides how to show it. The same split works for any system whose data more than one interface needs, which is why the pattern now shows up in commerce, customer data and internal tools as well as publishing.
What are the layers of a headless architecture?
A headless system has four layers: the data or content store, the API that exposes it, an optional delivery layer that caches it, and the frontends that present it.
- Store and management. The database, the content model, the editing interface, permissions and publishing workflow. This layer knows nothing about pages or screens.
- API. The contract. It returns structured records (an article, a product, a customer) with stable identifiers and documented fields. Versioning and authentication live here.
- Delivery. A CDN, cache or edge layer that serves API responses and pre-built pages close to the reader. It is optional, but it is where most of the speed comes from.
- Heads. The website, the mobile app, the kiosk, the partner portal, the Slack bot, the voice or AI assistant. Each is a thin client that asks the API for data and renders it its own way.
Drawn as a diagram, the arrows only point one way: heads call the API, the API reads the store. No head talks to the database directly, and the store never calls a head. That one-way dependency is the whole pattern; the rest is implementation.
How does headless differ from a traditional, coupled system?
In a coupled system, data and presentation ship as one application, so changing the frontend means changing the backend. In a headless system they ship separately, so each side can change on its own schedule.
| Coupled (traditional) | Headless | |
|---|---|---|
| Rendering | The backend renders the pages | Each frontend renders its own view |
| Channels | One, usually the website | Any client that can call the API |
| Frontend technology | Fixed by the platform | Chosen per frontend |
| Team coupling | Frontend changes wait on backend releases | Teams release independently against the API contract |
| What you give up | Little; preview and layout tools come built in | Built-in preview, page layout tools, and one place to debug |
Does the headless pattern apply beyond a CMS?
Yes. Headless is a general principle: put the data behind a contract and let presentation be somebody else’s concern. Content management was only the first domain to make it popular.
A product catalog that feeds a web store, a mobile app and a wholesale portal is headless commerce. A customer record that a sales dashboard, a marketing tool and a self-service portal all read through one API is headless customer data. A digital asset library that serves images to every channel from one store is a headless DAM. In data engineering the same idea appears as a semantic or metrics layer: definitions live in one governed place, and every BI tool, notebook and application queries them instead of re-deriving them. In each case the gain is the same. Data access, transformation and caching are written once, and each interface stays thin.
When should you use headless architecture?
Use it when the same data must reach more than one interface, or when the frontend has to change faster than the backend can. Avoid it when one website is the only consumer and the team is small.
Headless earns its cost when there are several heads, when frontend and backend teams are separate, or when the presentation needs a technology the platform cannot run. It is the wrong choice for a single marketing site maintained by one person: the team takes on an API to version, a frontend to host, a build pipeline and a preview problem, and gets nothing back that a coupled CMS would not already give. A useful test is to name the second head. If nobody can, the coupled system is simpler and the better design.
How do you migrate to headless architecture?
Migrate one route or one channel at a time behind the existing system, not in a single cutover: expose the data through an API first, then move the heads onto it.
The order that works is the strangler fig: put the API in front of the current store, point one new frontend or one section of the site at it, and keep the rest on the old renderer until each part moves. Model the content as structured fields before migrating it, because a headless frontend cannot do much with a blob of page HTML. Plan preview, redirects and search metadata early; they are what coupled systems did for free, and they are what headless migrations most often break. Martin Fowler’s description of the strangler fig application is the clearest account of the incremental approach.
What happens when many frontends share one API?
The shared API either swells to serve every head or splits into per-client endpoints. The Backend for Frontend pattern makes that split deliberate.
With a few heads, one general API serves all of them well. As heads multiply and their needs diverge, the API starts carrying fields and endpoints that only one client uses, and every change risks breaking another client. The Backend for Frontend pattern adds a thin API layer per kind of client, owned by that client’s team, that composes calls to the shared services. It costs another layer to run, so it is worth adding when the divergence is real, not in advance of it.
Related: Headless CMS as the microservices pattern for publishing and WordPress as serious architecture, the case for the coupled side of the trade.