OpeNext CMS · Developer Docs

Multi-Tenant Architecture

Each tenant gets an isolated database for pages, themes, roles, and settings.

Overview

OpeNext CMS is multi-tenant by design. Tenancy is implemented as separate MongoDB databases per tenant — not shared tables with a tenant ID column. This keeps data cleanly isolated.

What lives in each tenant DB

  • Pages and block content
  • Themes and theme configurations
  • Roles and user assignments
  • Settings and seeded defaults

Auto-seeding

On first access to a fresh tenant database, the system seeds default data — including roles, settings, and the five system themes (with Startup as the default active theme).

Manual re-seed

To re-seed or update system themes after code changes, run the seed script from the CMS repo:

npx tsx scripts/seedThemes.ts

Scaling

  • Use MongoDB Atlas for managed scaling and backups
  • Monitor database count as you add tenants
  • Active theme is cached in-process (5s TTL) for fast public page loads