Deployment Architecture
Part of: MPAC SmartPOS Cloud Platform - Product RequirementsVersion: 2.0 Last Updated: 2026-01-28
Overview
This section documents the deployment architecture, infrastructure, and operational procedures for the MPAC SmartPOS Cloud Platform. The deployment strategy emphasizes zero-downtime deployments, automated testing and validation, and quick rollback capabilities to ensure high availability and reliability.
Documents in This Section
1. AWS Infrastructure
Complete AWS infrastructure architecture including compute (ECS Fargate), database (RDS PostgreSQL), caching (ElastiCache Redis), load balancing, storage (S3), networking (VPC), and DNS (Route 53). Details instance types, scaling policies, backup strategies, and high availability configurations.
Key Topics:
- ECS Fargate with auto-scaling
- RDS PostgreSQL Multi-AZ with read replicas
- ElastiCache Redis cluster mode
- Application and Network Load Balancers
- S3 bucket organization and lifecycle policies
- VPC architecture with public/private subnets
- Route 53 DNS with health-based failover
2. Deployment Strategy
Deployment approach using blue-green pattern for zero-downtime releases. Covers gradual traffic shifting, backward-compatible database migrations, and comprehensive rollback procedures.
Key Topics:
- Blue-green deployment flow with gradual cutover (5% → 50% → 100%)
- Backward-compatible database migrations (two-phase deploy)
- Instant rollback via traffic shifting
- Database migration rollback procedures
- Feature flag-based rollback
- Monitoring and alerting during deployment
3. Environments
Environment strategy covering Development (Docker Compose), Staging (AWS scaled down), Production (AWS full scale), and Disaster Recovery (AWS standby). Details staging environment configuration including synthetic load testing and automated integration tests.
Key Topics:
- Four-environment strategy (Dev, Staging, Production, DR)
- Staging environment mirrors production at 25% capacity
- Real payment provider test accounts in staging
- Synthetic load testing scenarios and schedules
- Automated integration test suites
- DR environment with 15-minute RTO
4. CI/CD Pipeline
Complete GitHub Actions workflow for continuous integration and deployment. Covers automated testing, Docker image building, deployment to staging and production, and monitoring automation.
Key Topics:
- GitHub Actions workflow with parallel test jobs
- Service-specific testing (Python, Go, TypeScript)
- Code coverage requirements (80% minimum)
- Docker image building and pushing to ECR
- Automated deployment to staging (develop branch)
- Manual approval + blue-green deployment to production (main branch)
- Deployment monitoring and auto-rollback scripts
5. Observability Stack (mpac-obs)
Centralized monitoring, logging, and tracing infrastructure for the entire platform. Covers local Docker Compose setup and AWS ECS Fargate deployment with CloudFormation. Includes Prometheus for metrics, Loki for logs, Tempo for traces, and Grafana for visualization.
Key Topics:
- mpac-obs directory structure and components
- Local development with Docker Compose
- AWS deployment with ECS Fargate and CloudFormation
- OTLP collector (Alloy) on ports 4317/4318
- Service auto-discovery from ECS task labels
- Prometheus (metrics), Loki (logs), Tempo (traces), Grafana (dashboards)
- Data retention policies (14 days metrics/logs, 7 days traces)
- EFS persistent storage configuration
- Grafana access with SSO authentication
Quick Reference
Deployment Flow
Developer Push → GitHub Actions
├─ Run Tests (parallel)
│ ├─ svc-portal (Python): lint, type check, unit tests
│ ├─ svc-smarttab (Go): lint, unit tests
│ ├─ mpac-pgw (Go): lint, unit tests
│ └─ frontend (TypeScript): lint, type check, unit tests, build
├─ Build Docker Images
│ └─ Push to ECR with commit SHA tag
├─ Deploy to Staging (develop branch)
│ ├─ Update ECS task definitions
│ ├─ Deploy to ECS
│ ├─ Run smoke tests
│ └─ Notify team
└─ Deploy to Production (main branch)
├─ Require manual approval (2 approvers)
├─ Blue-green deployment (gradual traffic shift)
├─ Monitor for 1 hour
├─ Auto-rollback on errors
└─ Notify teamRollback Options
| Method | Use Case | Timeline | Complexity |
|---|---|---|---|
| Traffic Shift | Post-deployment issues | 30-60s | Low |
| Feature Flag | Specific feature bugs | < 5s | Very Low |
| Database Rollback | Schema corruption | 5-10min | High |
| Emergency | Critical security issue | < 30s | Low |
Environment URLs
| Environment | Portal URL | API URL | Access |
|---|---|---|---|
| Development | localhost:3000 | localhost:8002 | Local only |
| Staging | mpac-cloud-stg.com | api.mpac-cloud-stg.com | Internal |
| Production | portal.mpac-cloud.com | api.mpac-cloud.com | Public |
| DR | dr.mpac-cloud.com | api.dr.mpac-cloud.com | Failover only |
Related Documentation
Prerequisites
Before working with deployment, review:
- System Architecture - Overall system design
- Database Architecture - Schema design and migrations
- Security Architecture - Security controls
Related Operations
- Observability Stack - mpac-obs monitoring, logging, and tracing
- Database Maintenance - Backup and recovery procedures (see Appendix)
- Performance & Scalability - Detailed observability implementation
- Incident Response - Runbooks and escalation procedures (see Appendix)
Navigation
Up: References IndexNext Section: Integration Specifications