Registration Service — Deployment Topology
Status: populated
Owner: TBD
Last updated: 2026-04-17
Companion: Service Template
1. Runtime
| Property | Value |
|---|
| Runtime | Node.js 22 / NestJS 11 |
| Language | TypeScript 5.x |
| Package | @ghasi/service-registration |
| Default port | 3003 |
| Base image | node:22-alpine |
2. Replicas and Scaling
| Environment | Min replicas | Max replicas | Scaling trigger |
|---|
| Development | 1 | 1 | — |
| Staging | 2 | 4 | CPU > 60% or RPS > 100 |
| Production | 3 | 10 | CPU > 60% or RPS > 500 |
Horizontal Pod Autoscaler (HPA) based on CPU utilization and custom metric registration_active_requests.
3. Kubernetes Resource Requests
| Resource | Request | Limit |
|---|
| CPU | 250m | 1000m |
| Memory | 256Mi | 512Mi |
4. Regional Deployment
| Region | Notes |
|---|
| Afghanistan (Kabul DC) | Primary; data residency required |
| UAE | Secondary tenant region |
| DR region | Read replica of DB; no writes |
No cross-region patient data replication unless within same jurisdiction per data residency policy.
5. Dependencies
| Dependency | Purpose | Required |
|---|
PostgreSQL 16 (with pg_trgm) | Primary data store | Yes |
| Redis | Idempotency key store (24h TTL) | Yes |
| NATS JetStream | Event publishing (outbox relay) | Yes |
| Keycloak | JWT validation via JWKS | Yes |
| config-service | Tenant configuration lookups | Yes |
| terminology-service | Vocabulary/code lookups | Soft (fail-open) |
| audit-service | Audit event emission | Yes |
| Object storage (S3-compatible) | Portrait binary storage | Soft (portrait feature) |
6. Deployment Diagram