Skip to main content

Deployment Topology

:::info Source Sourced from services/progress-service/DEPLOYMENT_TOPOLOGY.md in the documentation repo. :::

1. Containers

ContainerPurpose
progress-apixAPI + internal REST
progress-ingestHigh-throughput statement ingest pipeline
progress-projectorAttempt + completion projection from statements
progress-outbox-relayNATS publisher
progress-partition-managerpg_partman scheduled jobs (create + detach)

2. Scaling

ContainerMinMaxHPA
progress-api550CPU > 60% or req-rate > 500 rps
progress-ingest5100queue depth > 1000
progress-projector320projection lag > 10s
progress-outbox-relay38outbox backlog > 5000

3. Resources

ContainerCPU req/limitMem req/limit
progress-api500m / 2000m512Mi / 2Gi
progress-ingest1000m / 4000m1Gi / 4Gi
progress-projector500m / 2000m512Mi / 2Gi

4. Storage

  • Postgres — primary + 2 replicas (read scale-out).
  • Partitioning — monthly + tenant-hash.
  • Cold archive — S3 Parquet after 180 days.
  • WAL archive — continuous to S3 cross-region.

5. Caching

  • Redis (per region) — xAPI query cache (tenant + filters hash, 60s TTL).
  • pgbouncer transaction-mode pool.

6. CDN

  • None (all endpoints authenticated, no public caching).

7. Edge Rules

  • Rate limits at edge (per tenant + per user, §API_CONTRACTS §8).
  • xAPI ingest from allowlisted 3rd-party LRSes require IP + API key.

8. Regional Deployment

  • One cluster per residency region.
  • Statements pinned to tenant homeRegion.
  • Analytics firehose cross-region via Kafka MirrorMaker.

9. Service Mesh

  • mTLS.
  • Egress: analytics-service (firehose), certification-service (completion event), notification-service, enrollment-service.

10. Release Strategy

  • Rolling for ingest/projector (stateless).
  • Blue/green for API.
  • Migrations applied pre-deploy; CI runs fwd+back.

11. DR

  • RPO 5 min (WAL archive).
  • RTO 90 min (restore + replay event log).
  • Event log is source-of-truth; tables can be rebuilt.

12. Diagram

delivery/assessment ──▶ NATS ──▶ progress-ingest ──▶ Postgres (statements, attempts)


progress-projector (derive attempt outcomes + completions)


outbox → NATS ──▶ certification, assignment, analytics, notification

xAPI clients ──HTTPS──▶ progress-api ──▶ Postgres read replicas
└─▶ Redis (query cache)