Headless CMS Architecture: Four Production Patterns

Headless CMS Architecture: Four Production Patterns

Write region, replicas, edge delivery, China isolation — the headless CMS decisions the platform never makes for you, in four production patterns with illustrative cost bands.

Headless CMS architecture is the set of decisions the CMS does not make for you — write region, read-replica strategy, edge delivery, and China isolation are infrastructure choices that decide performance and compliance regardless of which platform you pick. This guide walks four production patterns (single-region startup, multi-region global, edge-delivered, China-isolated), the database and CDN topology underneath them, and illustrative monthly cost bands, ending with the decisions to settle before you provision anything.

Why architecture matters more than CMS choice

Teams evaluate headless platforms at length and then provision the infrastructure in an afternoon, which is exactly backwards. Many production "CMS performance problems" are infrastructure problems wearing a CMS costume: a slow page is often a missing read replica, a cold edge cache, or a render path that calls a database on another continent — not a slow content model. The platform comparison decides editorial ergonomics. The architecture decides whether the site is fast, available, and lawful.

Three forces pull the decision out of the CMS and into the topology. Multi-region read traffic forces a write-region and replica choice the CMS will not make for you. Running code at the edge forces a trade between global latency and stricter runtime limits. And data-residency law — China's Personal Information Protection Law (PIPL) most sharply — can require personal information collected and generated in China to be stored in China (for critical information infrastructure operators and processors reaching a volume set by the Cyberspace Administration of China, with the transfer conditions and exemptions covered under Pattern 4 below), which turns hosting location into an architectural decision; whether a hosted SaaS CMS can meet it depends on whether the vendor offers in-country infrastructure. A SaaS CMS abstracts the content API, but it does not make the frontend, CDN, or data-residency decisions for you; those remain your decisions whichever vendor you sign with.

Cost is the other reason to treat this as a first-class decision. The patterns below span an order of magnitude. As illustrative planning bands rather than measured benchmarks, a single-region startup deployment runs roughly $200 to $800 a month all-in, a four-region global footprint sits in the low thousands before the CMS license, adding China is a $1,500 to $3,000 monthly adder on top, and a full global enterprise build with redundancy, observability, and a regulated boundary can pass $20,000 a month. Choosing the wrong pattern is not a tuning mistake you fix later — it is a re-platforming project, which is among the most expensive moves on this map. Vendor pricing also moves; treat every figure here as a 2026 order-of-magnitude band to re-verify at decision time, not a quote.

PatternScaleMonthly infra cost bandWhen it fits
1. Single-region startup≤100K MAU$200–$800 all-inOne market, one editing team, no residency law
2. Multi-region global≤1M MAU, 4 regions$1,500–$3,500 (excl. CMS license)Global read traffic, no China requirement
3. Edge-deliveredcontent-heavy, low writefolds into pattern 1/2 + edge feesMarketing/brochure at global scale, infrequent writes
4. China-isolatedadds to pattern 2 or 3+$1,500–$3,000 for the China instanceHosting for mainland China, or PIPL Article 40 storage duty applies (subject to its conditions and exemptions, see Pattern 4)

The cost bands in this table are illustrative planning bands, not quotes or measured benchmarks; re-verify vendor pricing at decision time.

Pattern 1 — single-region startup (≤100K MAU)

The first production architecture is deliberately small, and the discipline is to keep it that way until traffic or law forces a change. One AWS region — typically us-east-1 for a US-led audience or ap-northeast-2 (Seoul) for an Asia-led one — or a single Vercel deployment carries the whole site. A single managed PostgreSQL instance on AWS RDS or a comparable managed Postgres host holds content, with daily automated snapshots and point-in-time recovery enabled from day one rather than retrofitted after the first incident.

Media is the only piece that benefits from a CDN at this scale: an S3 bucket fronted by CloudFront, or an image service that does on-the-fly resize and format negotiation, keeps large assets off the application server. The same CDN can cache HTML with a short time-to-live. There is no read replica, no failover region, and no message queue, because at 100K monthly active users none of those earn their operational cost — every component you add is a component you monitor, patch, and reason about during an outage.

The honest framing is that this pattern is correct far longer than teams believe. The instinct to provision a multi-region topology "so we do not have to migrate later" can buy complexity long before the traffic that would justify it, and an idle replica is a recurring bill plus a second thing that can fail. The single-region pattern earns its keep precisely because it is boring, and the right time to leave it is when a concrete number — sustained read latency in a second region, or a residency obligation — makes the next pattern necessary, not when an architecture diagram looks more impressive.

Pattern 2 — multi-region global (4 regions, ≤1M MAU)

When read traffic is genuinely global, the architecture changes shape: one write region and several read regions. The primary region is wherever the editorial team and the authoritative database live — often Seoul or Singapore for an Asia-led brand, us-east-1 for a US-led one — and it is the only place content is written. Read replicas in each high-traffic region serve the read path so a reader in Frankfurt is not waiting on a round trip to Seoul for every page.

The reference shape for a four-region build is a Postgres primary in the editorial region with read replicas in us-east-1, eu-central-1, and ap-southeast-1, a Next.js frontend deployed across a global edge network, and object storage (S3 or an R2-style equivalent) fronted by regional CDN edges. For illustration, consider a global manufacturer running an Asia primary plus US, EU, and China presence: under the planning bands above, the four-region infrastructure might sit in the low-to-mid thousands per month before the CMS license, and could cross $20,000 a month once redundancy, observability, a regulated China boundary, and on-call tooling are included. The line item that surprises finance is often not compute — it is cross-region data transfer and the duplication that residency forces, which is why the China adder is treated as its own pattern rather than a footnote.

The decision this pattern forces and the CMS does not is the write-region choice. Putting the primary where the editors are keeps publishing fast and replication one-directional; putting it where the largest read audience is optimizes the wrong path, because reads are already served by replicas and writes are the operation that must not contend. Pick the write region for the people who write, and let replicas absorb the people who read.

Pattern 3 — edge-delivered Next.js + Vercel/Cloudflare

The third pattern moves delivery to the edge so that most page requests are answered from a cache at the point of presence nearest the user, eliminating the manual region planning of pattern 2 for the read path. CMS reads happen at build time for fully static pages, or during regeneration for incrementally regenerated ones, so the database is touched when a page is revalidated rather than on every request. The practical result is low time-to-first-byte globally without provisioning replicas in named regions.

The mechanism is incremental static regeneration plus a CDN edge cache. A content page is generated once, served from cache everywhere, and revalidated on an interval or on a publish webhook rather than rendered fresh per visitor. In Next.js, ISR runs only on the Node.js runtime (the default), not on the edge runtime.

typescript
// A content route: regenerate at most every 5 minutes (Node.js runtime, the default).
export const revalidate = 300

The trade-off is real and worth stating before a team commits. Code that does execute at the edge runs in constrained runtimes. Vercel's Edge runtime limits code size to 1 to 4 MB after gzip depending on plan, cannot read or write the filesystem, and supports only some Node.js APIs; Vercel also recommends migrating from edge to Node.js, and from Next.js 16.3 setting runtime = 'edge' is no longer supported (as of Oct 2026, Vercel Edge runtime documentation). Cloudflare Workers with Node.js compatibility enabled get only a virtual filesystem — read-only bundle files and a writable /tmp that does not persist beyond the request. Logic that assumes a full Node server has to be checked against each platform's documented limits, refactored, or kept off the edge. That makes this pattern an excellent fit for content-heavy sites with infrequent writes — marketing, documentation, brochure, editorial — and a poor default for transaction-heavy flows that need a long-running server, server-side SDKs with filesystem assumptions, or per-request database writes. Edge delivery is a strength precisely because it is opinionated; it is the wrong tool the moment the workload violates the opinion.

Pattern 4 — China-isolated (in-country instance)

China is not a region you add to pattern 2 — it is a separate deployment governed by separate law, and treating it as a configuration flag is how launches slip badly. PIPL Article 40 requires critical information infrastructure operators, and processors handling personal information in amounts that reach a level set by the Cyberspace Administration of China (CAC), to store personal information collected and generated in China inside China; where providing it abroad is truly necessary, it must pass a security assessment organized by the CAC, unless laws, administrative regulations, or CAC rules provide that no assessment is needed. More broadly, any processor that truly needs to provide personal information outside China for business or similar needs must meet one of the four conditions in Article 38 — a CAC security assessment under Article 40, personal information protection certification by a professional body under CAC rules, a contract with the overseas recipient on the CAC standard contract setting out both parties' rights and obligations, or other conditions set by laws, administrative regulations, or the CAC (where international treaties or agreements China has concluded or joined set conditions for providing personal information abroad, those provisions may be followed) — and must take necessary measures so that the overseas recipient's processing meets PIPL's protection standards; Article 39 also requires telling individuals the recipient's name and contact details, the purpose and method of processing, the categories of personal information, and how to exercise their PIPL rights against the recipient, among other items, and obtaining their separate consent. Where the localization duty applies, one way to meet it is a distinct instance on AWS China (the Beijing or Ningxia Region) or a domestic cloud such as Alibaba Cloud, with the personal data in an in-country PostgreSQL database. PIPL itself does not prescribe a separate CMS instance or a domestic CDN; those, and a controlled content boundary, are architecture and delivery choices for serving mainland China. Cross-border residency obligations like this are the same class of constraint covered for the data-transfer side in the cross-border data transfer guide; the architectural answer is isolation rather than a transfer mechanism.

Two parts of this routinely blow schedules. The first is the ICP requirement for the site itself, a separate regulation from PIPL: under China's Measures for the Administration of Internet Information Services, providing internet information services within China requires a license for commercial (paid) services or a filing for non-commercial (free) ones, and without the license or the filing the service may not be provided. Cloud providers apply this to sites hosted on their mainland servers — Alibaba Cloud's filing process, for example, covers websites hosted on its Chinese mainland node servers. A filing is made by an organization or individual in China through the Ministry of Industry and Information Technology portal; once the materials are complete, the provincial communications administration must complete the filing within 20 working days (MIIT filing measures, Article 12 as amended in 2024), and Alibaba Cloud's documentation says this communications administration review usually takes 1 to 20 business days and cannot be expedited (as of Oct 2026, Alibaba Cloud ICP filing documentation). A commercial license is reviewed separately, with a decision due within 60 days of the application (Article 7 of the Measures). The second is content delivery: traffic routed through servers outside China faces significant latency and reliability issues there (as of Oct 2026, Cloudflare China Network documentation), so the China instance needs points of presence inside mainland China — a domestic CDN such as Alibaba Cloud CDN or a Tencent equivalent, or a global vendor's separate in-China offering such as the Cloudflare China Network, which runs on data centers operated by its partner JD Cloud, is a separate subscription for Enterprise customers, and requires an ICP filing or license for each apex domain.

Content flows one way. The global primary CMS pushes published content into the China instance through a publish hook or a scheduled job; the China instance never writes back across the boundary, so the regulated edge is never crossed by an inbound write.

typescript
// Runs on the global primary only. Pushes published docs to the isolated China instance.
export const syncToChina: CollectionAfterChangeHook = async ({ doc }) => {
  if (process.env.REGION !== 'global-primary') return
  if (doc._status !== 'published') return
  await fetch(`${process.env.CHINA_INGEST_URL}/sync`, {
    method: 'POST',
    headers: { authorization: `Bearer ${process.env.CHINA_INGEST_TOKEN}` },
    body: JSON.stringify({ collection: 'posts', doc }),
  })
}

The architectural point is who controls the deployment. On a self-hostable platform, this entire pattern is a deployment decision you make; with a hosted CMS, it depends on whether the vendor offers in-country infrastructure — Storyblok, for example, states that Storyblok China runs on dedicated infrastructure in China — so confirm the China terms with the vendor. Budget the China adder, as a planning band, at $1,500 to $3,000 a month for the instance alone, plus ICP processing, and put the ICP filing or license on the critical path at project kickoff: the filing review alone can take up to 20 business days, and a commercial license review up to 60 days.

Database topology — primary, read replicas, vector DB

Underneath all four patterns is one database decision: a single write primary, read replicas where read traffic concentrates, and, when the site has retrieval features, a vector store. The single-write-primary rule is what keeps replication one-directional and reasoning about consistency tractable; the moment two regions can both write, conflict resolution becomes an application problem nobody scoped. Replicas are created with Postgres logical replication or managed AWS RDS read replicas, and they serve reads only.

The vector store is the newer decision. Retrieval-augmented features — internal AI assistants, AI search citation surfaces — need embeddings, and there are two honest defaults. Keeping vectors in the primary Postgres with the pgvector extension means one database to operate, back up, and secure, which is the right call until scale or recall quality forces a dedicated store; a managed vector database (such as Pinecone) or an edge-native option such as Cloudflare Vectorize is the move when the embedding workload outgrows a Postgres extension. Start in-database and externalize on evidence, not on a diagram.

Backups are not a topology afterthought. Daily snapshots plus point-in-time recovery with a retention window of at least 7 to 30 days is the floor for any pattern, single-region included, because a region outage is not the only way to lose content — an editorial mistake or a bad migration can destroy it too, and PITR is what makes that recoverable.

CDN and media — global delivery without the CMS bottleneck

The CMS should never be on the hot path for static delivery. HTML, CSS, JS, and images are served from a CDN — CloudFront, Cloudflare, or Fastly — with a long time-to-live for fingerprinted assets and a short one for HTML, while content pages use incremental regeneration so the database is read on a schedule, not per request. The cache strategy is the performance story far more than the CMS benchmark is: a correctly tiered cache makes a modest origin feel instant, and a missing one makes a fast origin feel slow.

Media transforms deserve a deliberate choice rather than a default. An image service that resizes and reformats on the fly removes a class of build-time work and a class of origin load; the alternative is a framework image pipeline backed by object storage, which keeps the toolchain smaller at the cost of doing transforms yourself. Either is defensible — the failure mode is having neither and serving full-resolution originals through the application server.

China breaks the single-CDN assumption, which is why it reappears here. A global CDN serving from outside China does not deliver reliably inside mainland China, so the China-isolated instance needs its own in-China delivery — a domestic CDN or a global vendor's separate in-China network — regardless of what the rest of the world uses. Planning one global CDN and discovering this at launch is the recurring mistake; the China instance is a separate delivery story end to end.

Monitoring, logs, and runbooks

An architecture you cannot observe is an architecture you cannot operate, and the patterns above each fail differently. Application monitoring and error tracking (a hosted analytics suite, Datadog, New Relic, or an error tracker such as Sentry) covers the request path; database monitoring (Amazon CloudWatch Database Insights for RDS, pgBadger, or equivalent) covers the layer that actually causes many "the site is slow" incidents; and real-user Core Web Vitals — not synthetic lab numbers — tell you what visitors in each region actually experience, which is the most direct measure of whether a global pattern is working.

The part teams skip is the runbook, and it is the part that matters at 3 a.m. Region failover steps, the read-replica promotion procedure, and the China-sync recovery procedure should be written, reviewed, and dry-run before launch, not drafted during the incident they describe. The cost of writing them is an afternoon; the cost of not having them is improvising a replica promotion under load while the site is down. A pattern is not production-ready because it is deployed — it is production-ready when the recovery from its specific failure modes is documented and rehearsed.

What to decide before you provision

  • Name the single write region based on where editors work, not where readers are — replicas serve readers, the primary must not contend.
  • Pick the smallest pattern a concrete number justifies today, and re-walk the choice at the medium-term traffic and residency horizon rather than only against now.
  • If you will host for mainland China, or PIPL's Article 40 storage duty applies to you, put the ICP filing or license (filing review up to 20 business days, commercial license review up to 60 days) on the critical path at project kickoff and budget the separate instance as its own line.
  • Decide the vector-store path explicitly: pgvector in the primary until recall or scale forces a dedicated store, not a managed store by default.
  • Set the backup floor — daily snapshots plus 7-to-30-day point-in-time recovery — on every pattern including single-region, because data loss can come from editorial mistakes, not only from regional outages.
  • Write the failover, replica-promotion, and China-sync runbooks before launch and rehearse them once.
Project Inquiry