Single Instance
Horizontally Scaled
For multiple instances behind a load balancer:Requirements for Scaling
- Redis/Valkey: Required for cross-instance rate limit coordination and API key sync
- S3: Required for response persistence (shared across instances)
- Shared encryption key: All instances need the same
ENSEMBLE_ENCRYPTION_KEY
Redis Configuration
AWS Deployment (Fargate)
Recommended production deployment:| Component | AWS Service |
|---|---|
| Compute | ECS Fargate (1 vCPU, 2GB per task) |
| Load Balancer | ALB with WebSocket support |
| Rate Limit Store | ElastiCache for Redis (Valkey) |
| Response Storage | S3 |
| Database | SQLite (ephemeral, on EFS if persistence needed) |
| Secrets | SSM Parameter Store or Secrets Manager |
Docker
Environment Configuration
Key environment variables for production:Health Checks
- ALB target:
GET /api/v1/health(returns 200 when healthy) - Deep health:
GET /admin/status(includes provider connectivity)