# Scalability Evolution Plan The platform evolves through 4 workload-driven scaling stages rather than catalog count alone. --- ## 4-Stage Workload Evolution ```mermaid flowchart TD S1["Stage 1: Initial Growth\nCatalog < 1M | Low/Medium Traffic\nSingle MySQL Primary + Redis + Single OpenSearch Node + Modular FastAPI"] S2["Stage 2: High Traffic\nHigh Traffic | Read Replicas + Celery Workers + Multi-Node OpenSearch Cluster + CDN"] S3["Stage 3: Large Catalog + High Traffic\nMySQL Date/Category Partitioning + Dedicated Ingestion Pipelines + Workload Isolation"] S4["Stage 4: Extreme Scale\nMySQL Sharding / Vitess Evaluation + Dedicated POS Sync Gateway + Analytics Warehouse"] S1 --> S2 --> S3 --> S4 ``` --- ## Stage Specifications ### Stage 1: Initial Launch * Single Primary MySQL instance. * Redis for caching. * Single-node OpenSearch instance for development/staging. * Unified FastAPI application cluster behind Nginx. ### Stage 2: High Traffic * Introduction of MySQL Read Replicas for read-heavy operations. * Dedicated Celery worker cluster backed by RabbitMQ. * Multi-node OpenSearch production cluster. * CDN caching for product images and static assets. ### Stage 3: Large Catalog + High Traffic * Table partitioning on historical tables (`orders`, `audit_logs`, `outbox`). * Dedicated ingestion pipelines for catalog updates. * Workload isolation (POS sync traffic isolated from web storefront traffic). ### Stage 4: Extreme Scale * Evaluation of MySQL-compatible sharding (Vitess or application-level sharding). * Dedicated analytics warehouse (ClickHouse / BigQuery). * Independent POS synchronization gateway microservices.