Tenant Orchestrator
The part of the system that creates the systems.
- type:
- Provisioning & delivery
- context:
- Professional work
- area:
- Platform · Delivery
- stack:
- 8 technologies
spec.yaml
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
- Tenant orchestration & registry service (Node/Express, PostgreSQL, Redis)
- Proxy middleware routing requests to the right tenant services
- GitLab CI stages: security (Gitleaks) → test → setup → deploy → db-migrate → PM2 services
- 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