Skip to content

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 team

Rollback Options

MethodUse CaseTimelineComplexity
Traffic ShiftPost-deployment issues30-60sLow
Feature FlagSpecific feature bugs< 5sVery Low
Database RollbackSchema corruption5-10minHigh
EmergencyCritical security issue< 30sLow

Environment URLs

EnvironmentPortal URLAPI URLAccess
Developmentlocalhost:3000localhost:8002Local only
Stagingmpac-cloud-stg.comapi.mpac-cloud-stg.comInternal
Productionportal.mpac-cloud.comapi.mpac-cloud.comPublic
DRdr.mpac-cloud.comapi.dr.mpac-cloud.comFailover only

Prerequisites

Before working with deployment, review:

  • 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)

Up: References IndexNext Section: Integration Specifications

MPAC — MP-Solution Advanced Cloud Service