# Deployment & Infrastructure Specifications ## Production Deployment Topology ```mermaid flowchart TD DNS["Cloudflare CDN / DNS"] --> Nginx["Nginx Reverse Proxy & SSL Termination"] Nginx --> StorefrontUI["Next.js Storefront App (Port 3021)"] Nginx --> AdminUI["Next.js Admin ERP App (Port 3022)"] Nginx --> FastAPIServer["FastAPI Backend Cluster (Port 8000)"] FastAPIServer --> PrimaryDB[("MySQL Primary Database")] FastAPIServer --> ReadReplicas[("MySQL Read Replicas")] FastAPIServer --> RedisCluster[("Redis Cluster")] FastAPIServer --> OpenSearchCluster[("OpenSearch Cluster")] FastAPIServer --> RabbitMQ["RabbitMQ Message Broker"] RabbitMQ --> CeleryWorkers["Celery Background Worker Nodes"] ``` --- ## Non-Breaking Rollout & Deployment Sequence 1. **Phase 1 (Expand)**: Run DB migrations (`alembic upgrade head`) adding new tables and nullable/default columns. 2. **Phase 2 (Deploy)**: Deploy updated FastAPI backend and worker services. 3. **Phase 3 (Backfill)**: Trigger Celery workers to backfill data projections or search indexes. 4. **Phase 4 (Contract)**: Drop obsolete tables/columns in a subsequent release window.