Design the deployment and operations plane for an enterprise application offered in four modes: shared multi-tenant SaaS, dedicated hosted instances, customer-owned VPCs, and fully air-gapped installations. We must safely release code/config/policy, observe SLOs, honor residency and tenant keys, recover disasters, and upgrade a large fleet.
One Product. Four Sovereignties.
Design a managed deployment plane spanning shared SaaS, dedicated instances, customer VPCs, and air-gapped sites—with signed releases, policy-safe configuration, fleet observability, SLOs, keys, residency, and recoverable upgrades.
Opening prompt
The interviewer gives a deliberately broad application problem. The candidate creates structure before drawing boxes.
I’ll separate a global product/control plane from independently survivable regional or customer data planes. “Same product” means one signed release contract and conformance suite, not identical infrastructure. I need the fleet mix, regulatory boundaries, customer approval windows, maximum version skew, telemetry permitted per mode, data classifications, RPO/RTO tiers, and whether 8090 or the customer owns incident actions.
My invariant: no deployment fetches mutable “latest” artifacts. Desired state pins content hashes for code, schemas, config, policy, and models. Data planes continue serving safely if the control plane is unavailable; air-gapped sites never require runtime connectivity.
Scope the contract
Actors, boundaries, correctness, latency, and what deliberately waits for a later phase.
Give actors, functions, NFRs, and what you will not build initially.
Actors: product/release engineers, tenant admins, security/compliance, site reliability, customer VPC/site operators, support, auditors, and automated reconcilers. Required: tenant/deployment inventory; placement and residency policy; signed hermetic bundles; separate config/policy schemas; approval and rollout rings; preflight, backup, migration, health gate, rollback; drift detection; tenant key references; metrics/log/trace contracts; incident and audit export; DR plans and restore evidence; offline import/export.
Mock targets: 1,200 deployments across 12 regions; shared tier 99.95%, dedicated critical tier 99.99%; control-plane loss must not break serving; shared RPO <5 min/RTO <30 min, dedicated tiered, air-gap customer-agreed; critical CVE patch to connected fleet in 24 hours and offline bundle in 72. Out of scope: one-off forks per customer, silent breaking config changes, remote shell into air gaps, and universal raw-log export.
Release engineers, SRE, customer/VPC/site operators, tenant admins, security/compliance, support, auditors.
Fleet inventory, placement, signed bundles, desired state, rings, migrations, drift, telemetry, support, DR, offline import/export.
Pin code/config/policy/model digests; secrets stay local; data planes survive control loss; every upgrade journaled.
1,200 units/12 regions; 99.95–99.99% tiers; critical connected patch <24 h; offline bundle <72 h; tiered RPO/RTO.
Residency, tenant/CMK keys, mTLS identity, signed artifacts, narrow support access, no persistent air-gap backdoor.
Customer forks, unsigned emergency changes, silent config breakage, raw central telemetry, universal remote shell.
Back-of-the-envelope math
These numbers are supplied mock constraints. Change them to see where the design bends.
Assume 1,200 deployment units, 40 concurrent upgrades, 20 minutes each, 2% manual-intervention rate, 30 telemetry samples/minute/deployment, and 1 KB/sample. Do the math.
A no-pause fleet pass is 30 waves and 600 minutes—10 hours. Two percent means about 24 interventions, enough to overwhelm a small on-call if we do one global blast; canary rings and automatic halt are mandatory. Telemetry is 36,000 samples/minute, 600/s, about 600 KB/s or 51.8 GB/day before replication and index amplification. Logs/traces can be orders of magnitude larger, so budgets, sampling, and tenant-safe labels matter.
The fleet unit may be a shared regional cell rather than one tenant. I size and roll out by fault domain and risk tier, not only count. Air-gap upgrades have human lead time, so supported-version windows and compatibility matrices are a product feature.
Fleet rollout and telemetry envelope
Data, keys, and APIs
Names turn ambiguous boxes into durable contracts. The primary keys below are part of the answer.
What are your records and APIs? Distinguish release, configuration, policy, and secret.
A ReleaseBundle is immutable: application images, migration steps, model/assets, SBOM, provenance attestation, compatibility ranges, conformance results, and signature. A ConfigSet contains nonsecret operational values validated by a schema. A PolicySet is effective-dated business/security behavior with its own approvers. A SecretRef points to a deployment-local secret manager or customer KMS; secret bytes never enter global desired state.
DeploymentDesiredState pins all four digests plus placement, release channel, maintenance window, and data/key policy. Reconciler reports observed state and health with a monotonic generation. Rollout attempts and approvals are append-only. APIs create signed promotions, propose desired-state changes with expected generation, approve, pause, rollback, report drift, and export offline bundles/attestations.
Records and access paths
| Record | Primary / idempotency key | Important immutable fields | Main access path |
|---|---|---|---|
Deployment | (deployment_id, environment) | tenant/cell, mode, region, tier, owner, support window | fleet inventory; risk/version skew |
ReleaseBundle | release_digest | images/assets/migrations, SBOM, provenance, compatibility, signature | promotion; offline export; CVE impact |
ConfigSet | (config_id, version_digest) | schema, nonsecret values, scope, author/approval | desired-state composition; diff |
PolicySet | (policy_id, version_digest) | effective dates, rules/security behavior, dual approvals | tenant/runtime policy selection |
DesiredState | (deployment_id, generation) | release/config/policy/secret-ref digests, placement, window, channel | reconcile; drift; rollback |
UpgradeAttempt | (deployment_id, operation_id) | generation, stage journal, pre/post checks, receipts, failure/rollback | resume; fleet rollout audit |
TelemetryEnvelope | (deployment_id, interval_start, schema_version) | redacted aggregates, observed generation, signature | SLO/fleet health; offline export |
External contract
POST /v1/releases signed manifest + attestations
POST /v1/releases/{id}:promote source ring, target ring, approval
PUT /v1/deployments/{id}/desired-state If-Match: generation
POST /v1/rollouts selector + concurrency + gates
POST /v1/rollouts/{id}:pause|resume|rollback reason + dual approval
POST /v1/deployments/{id}/observations generation + health receipt
GET /v1/fleet/drift?region=&mode=&cursor= desired vs observed
POST /v1/offline-bundles target base/version + expiry
POST /v1/offline-attestations signed install/health receipt
POST /v1/support-sessions scope + TTL + customer approvalEnd-to-end architecture
Control truth stays authoritative; expensive or probabilistic work is asynchronous, bounded, and replayable.
Draw the architecture across four modes and trace one upgrade.
The global control plane holds product catalog, deployment inventory, release metadata, compatibility, rollout policy, and redacted fleet health. Artifacts are built hermetically, scanned, signed in a protected release service, and replicated to regional registries or exported as a signed offline package. Regional/data-plane reconcilers pull desired state, verify signatures and policy locally, take a backup/checkpoint, run preflight, deploy dark, migrate with expand/contract schemas, health-check, then atomically switch traffic.
Shared SaaS uses multi-tenant regional cells; dedicated uses one isolated stack/account; VPC uses a customer-side agent with outbound-only control channel or customer-triggered pull; air gap uses an import station and local reconciler. Observed state returns asynchronously where permitted. Control loss leaves the last approved state serving; local safety controllers can rollback without global permission and later upload receipts.
Roll forward in rings; migrate by contract
Minimum soak, domain health, expand/contract schemas, automatic halt, and operation journals make upgrades recoverable.
Deep dive into fleet rollout and database compatibility. A migration cannot be instantly reversed.
Rollout rings are internal test, one synthetic cell, employee tenants, low-risk shared cells, representative dedicated/VPC canaries, broad connected fleet, then offline channels. Advancement requires a minimum soak, SLO burn, migration reconciliation, and domain quality gates; failures halt the ring automatically. We cap concurrent units per region/account/customer and never consume all redundancy at once.
Database changes use expand/contract: add backward-compatible structures; deploy code that can read old/new and dual-write if necessary; backfill with throttling and checkpoints; verify counts/invariants; switch reads; only remove old schema after the minimum supported version ages out. Rollback changes the application route and feature flag; irreversible data transformation requires preimage/archive and a forward-fix plan. Bundle compatibility says which code can read each schema/config/policy version.
| Migration phase | Compatibility rule |
|---|---|
| Expand | Add schema that both old and new code tolerate. |
| Dual-read/write | One authority; idempotent backfill; compare invariants. |
| Switch | Atomic route/feature pointer with domain health gate. |
| Contract | Remove old schema only after minimum supported code ages out. |
| Failure | Use journaled preconditions and tested rollback/forward-fix—not blind rerun. |
Operate privately without a hidden backdoor
Customer-side verification, outbound identity, schema-limited telemetry, signed offline bundles, and explicit support consent preserve sovereignty.
Deep dive into VPC and air-gap operations. How do support, telemetry, and trust work without creating a backdoor?
The customer-side reconciler has a narrow, documented contract: verify approved bundle, apply desired state, collect redacted health, and produce signed receipts. It cannot access application data by default. VPC connectivity is outbound mTLS with customer allowlists, short-lived workload identity, and optional private endpoints. Support uses explicit time-bound customer approval, command allowlists, session recording, and break-glass—not persistent vendor SSH.
An air-gap bundle contains images, dependencies, models, migrations, SBOM, vulnerability data, schemas, conformance fixtures, and signatures. The import station validates chain of trust, anti-rollback policy, completeness, hardware/runtime compatibility, and clean-room tests. Telemetry export is a customer-reviewed, schema-limited signed package with aggregates and redaction; diagnostics can be generated locally. We publish offline security advisories and delta/full bundles, and receive an installation/health attestation when policy permits.
offline_bundle = release artifacts + migrations + models + dependencies
+ SBOM + vulnerability notice + conformance fixtures
+ compatibility matrix + rollback/forward-fix runbook
+ manifest signature + expiry + target base versionsFailure injection I
The design changes under pressure. The candidate preserves correctness before convenience.
Ring three corrupts a data index in 2% of dedicated instances; health checks only verify HTTP 200. Some schema steps completed. Revise.
The health gate was inadequate. I halt the rollout automatically on the domain invariant signal, isolate affected units, and keep unaffected units on the prior desired generation. For each affected deployment, the runbook inspects migration journal and index reconciliation. If the old code remains schema-compatible, route back and rebuild the derived index from authoritative data; if not, execute the tested forward-fix under incident approval. We never rerun a non-idempotent migration blindly.
Future gates include synthetic business transactions, count/checksum invariants, query-result parity, background job health, and a representative soak. Each migration step has a unique ID, precondition, checkpoint, postcondition, retry class, and compensating/forward action. The 2% pattern is sliced by database/version/region to find a compatibility cohort before resume.
Failure injection II
Partial failure, stale inputs, duplication, and unknown external outcomes are normal distributed states.
A critical zero-day requires a patch today. The global control plane is down, three VPC customers froze change, and six air-gapped sites are two releases behind.
Serving remains on last desired state. Release signing and artifact distribution have an emergency continuity path separated from general orchestration, with dual control and pre-authorized procedures—not an unsigned shortcut. Regional reconcilers can accept a signed emergency bundle from replicated catalogs. VPC customers receive impact, compatibility, and compensating-control guidance; we respect their authority and record risk acceptance rather than forcing a backdoor.
For air gaps we build patches against every supported base version or require an explicit staged upgrade, then ship signed full/delta bundles through the agreed channel. Sites validate locally and return attestation later. If an old version is outside support, that is visible in the fleet risk ledger before the incident. The long-term fix is support-window enforcement, dependency inventory/SBOM search, and regular offline upgrade rehearsals.
Security and operations
Tenant isolation, backpressure, observability, evaluation, SLOs, recovery, and cost belong in the core design.
Cover tenant keys/residency, idempotency, backpressure, observability, SLOs, and DR.
Placement policy is evaluated before provisioning and continuously: tenant data, backups, indexes, logs, and keys remain in allowed regions. Tenant envelope keys wrap data keys; dedicated/VPC may use customer-managed KMS grants. Key rotation is versioned and resumable. Cryptographic erasure is valid only when the encryption-key scope exactly matches the deletion target; a key shared by lawful retained records cannot be destroyed, so those records require object/row deletion plus backup-expiry and tombstone reconciliation under retention/legal-hold policy. Queue and telemetry labels use deployment IDs, never raw tenant data.
Reconcile uses generation and operation IDs; completed steps are journaled so retries are idempotent. Rollout queues enforce per-fault-domain concurrency, maintenance windows, retry budgets, and emergency priority without starving repair. Observe desired/observed drift, version skew, upgrade stage age/failure, SLO burn by cell, migration invariants, telemetry gaps, backup freshness/restore success, key errors, residency violations, and support access. DR is per tier: cell evacuation for shared, warm region or documented rebuild for dedicated, customer-coordinated VPC/air-gap; quarterly restore proves RPO/RTO.
Desired/observed generation, drift age, version/support skew, reconciliation lag, offline attestation age.
Ring health, SLO burn, business synthetic, migration invariants, stage failures, intervention/rollback time.
Per-region/fault-domain concurrency, maintenance windows, soak timers, retry budgets, emergency/repair priority.
Placement policy across data/backups/logs/indexes, envelope/CMK keys, resumable rotation, legal-hold-aware deletion.
Outbound mTLS, short-lived workload identity, customer-approved scoped commands, recorded break-glass, no standing shell.
Backup freshness is not enough: restore, reconcile, cell evacuation, region failover, and offline local recovery rehearsals.
Rollout and trade-offs
A credible production answer defines how it earns trust and how it retreats safely.
Rollout this platform and name the unavoidable trade-off.
First standardize release manifests and conformance without changing deployment; onboard shared internal cells; add dedicated instances; then VPC agents with two customers; finally offline bundle/import/receipt workflows. Run fleet inventory and drift in read-only mode before automatic reconciliation. Prove backup restore and rollback for each mode. Publish support/version policy and error budgets jointly with customers.
The trade-off is fleet uniformity versus customer sovereignty. Forcing one version simplifies operations but violates change control and air-gap reality; unlimited skew multiplies vulnerability and test matrices. I set explicit supported windows, compatible expand/contract contracts, strong incentives and visibility, while preserving customer approval and a narrow emergency process.
- Define one release/config/policy/secret contract and support matrix.
- Produce signed manifests and conformance for existing deployments.
- Onboard internal/shared cells with read-only drift first.
- Automate dedicated deployments and prove restore/rollback.
- Pilot outbound-only VPC reconcilers with two customers.
- Exercise offline export/import/attestation and a security patch.
- Enable automatic remediation only for low-risk drift.
- Publish version-risk, SLO, RPO/RTO, and intervention evidence per mode.
One-minute spoken recap
Practice this synthesis until it sounds conversational rather than memorized.
One-minute summary.
I’ll summarize immutable desired state, independent data planes, ringed upgrades, sovereignty, and recovery.
Reference shelf
Definitions, traps, and the final checklist stay outside the timed mock.
- Air gap
- An environment with no runtime network route to external/vendor systems.
- Anti-rollback
- A policy preventing installation of an older vulnerable or incompatible release.
- Attestation
- Signed evidence about an artifact build or deployment action.
- Cell
- A bounded deployment fault domain containing a subset of tenants/workload.
- Conformance suite
- Tests proving a deployment mode satisfies the same product contract.
- Desired state
- The exact immutable artifact/config/policy generation a deployment should run.
- Expand/contract
- Backward-compatible schema evolution that delays deletion until old code is gone.
- Fleet skew
- The distribution of versions/configurations across deployments.
- Hermetic build
- A build with declared, pinned inputs and no undeclared dependency fetches.
- Reconciler
- A controller that compares desired and observed state and applies idempotent steps.
- SBOM
- Software bill of materials: inventory of shipped components.
- Soak
- A minimum observation period before rollout advances.
- Assuming every tenant equals one deployment unit.
- Making serving depend synchronously on the global control plane.
- Fetching mutable latest images or policy at runtime.
- Putting secrets inside desired-state documents.
- Calling HTTP 200 a sufficient release health check.
- Running destructive schema migration before compatible code exists.
- Retrying an unknown migration step without an operation journal.
- Centralizing raw VPC/air-gap logs by default.
- Installing a persistent vendor support backdoor.
- Forcing an emergency patch without customer authority.
- Allowing unlimited version skew with no compatibility matrix.
- Claiming DR because backups exist without timed restore proof.
- Clarified actors, authority, business harm, and out-of-scope.
- Did correct BOTEC and named the variable that changes the architecture.
- Defined stable IDs, versions, access paths, and idempotency keys.
- Separated authoritative state from derived indexes and model output.
- Explained consistency, retries, backpressure, and unknown outcomes.
- Revised the design after both failure injections.
- Covered tenant isolation, secrets, least privilege, deletion, and audit.
- Named golden signals, domain quality metrics, rollout gates, and rollback.