orchestrator·design doc

Tenant Orchestrator

The part of the system that creates the systems.

spec.yaml
type:
Provisioning & delivery
context:
Professional work
area:
Platform · Delivery
stack:
8 technologies
Node.jsExpressPostgreSQLRedisKnexGitLab CIPM2Zod

01Problem

A multi-tenant platform needs tenants to be created, registered, routed and upgraded the same way every time — by pipeline, not by hand.

02Approach

An orchestration service with a tenant registry and proxy routing, delivered by a staged pipeline: secret scanning, build, environment setup, migrations and process management.

03Architecture← the interesting bit

  1. Tenant orchestration & registry service (Node/Express, PostgreSQL, Redis)
  2. Proxy middleware routing requests to the right tenant services
  3. GitLab CI stages: security (Gitleaks) → test → setup → deploy → db-migrate → PM2 services
  4. Structured logging with Winston; input validation with Zod

04Trade-offs & hard parts

risk.01Migrations and seeds must be repeatable for every tenant, in the right order.
risk.02Delivery has to be safe by default: secrets scanned before anything is built.

05Ownership

owner: Worked on tenant provisioning and delivery: the registry and proxy routing, and the CI pipeline that ships it.

— Hankish

next: /services/leecycleLeecycle