| Metadata | Value |
|---|---|
| Status | Active |
| Version | 1.1.0 |
| Last Updated | 2026-09-10 |
| Author | Sangeetha Grantha Team |
| Document Type | Design reference |
[!NOTE] Design/reference material: this page may include proposals or earlier implementation assumptions. Use current feature map for implemented behavior and current operating steps.
Status: Recommended | Version: 1.0 | Date: 2026-01-14 Target: Cost-effective scaling from 0 to 5M+ MAU Philosophy: “Serverless First” (Pay per use, minimal ops)
This document maps the Global Scale Architecture to specific Google Cloud Platform (GCP) services.
The strategy prioritizes Cloud Run (Serverless Compute) and Cloud SQL (Managed Database) to minimize operational overhead. This “Scale-to-Zero” capability ensures the platform is incredibly cost-effective during early growth phases ($50-$100/mo) but automagically scales to support millions of users without re-architecture.
graph TD
User((User)) --> GCLB[Global Ext. Load Balancer]
GCLB --> Armor[Cloud Armor WAF]
GCLB --> CDN[Cloud CDN]
subgraph "Edge / Static"
CDN --> GCS["Cloud Storage (Static Assets)"]
end
subgraph "Compute (Serverless)"
GCLB --> |API Traffic| CloudRun_API[Cloud Run: Backend API]
CloudRun_API --> |Async| PubSub[Pub/Sub]
PubSub --> CloudRun_Jobs[Cloud Run Jobs: AI Workers]
end
subgraph "Data & State"
CloudRun_API --> |Auth/Fast Read| Redis["Memorystore (Redis)"]
CloudRun_API --> |Transactional| CloudSQL_Primary[Cloud SQL: PostgreSQL]
CloudSQL_Primary -.-> |Rep| CloudSQL_Read[Cloud SQL: Read Replicas]
CloudRun_API --> |Search| VertexSearch[Vertex AI Search]
end
subgraph "GCP Managed AI"
CloudRun_Jobs --> Gemini["Vertex AI (Gemini Models)"]
end
| Generic Component | Recommended GCP Service | Why? |
|---|---|---|
| Edge / CDN | Cloud CDN + Media CDN | Global anycast IP, deepest edge caching integration with GCS. |
| Compute / API | Cloud Run (Gen 2) | Scales to 0. Auto-scales to N based on concurrency. No K8s management overhead. |
| Database | Cloud SQL Enterprise Plus | 99.99% SLA, Data Cache enabled for faster reads. Easier than managing AlloyDB for this scale. |
| Caching | Memorystore for Redis | Fully managed. “Cluster” tier for eventual global scale, “Standard” for now. |
| Search | Vertex AI Search | Fully managed semantic & keyword search. Removes need to manage Elasticsearch clusters. |
| Async Queue | Pub/Sub | Global message bus. Dead-letter queues included. Durable. |
| Object Store | Cloud Storage (GCS) | Standard class for uploads. Cheap, durable, integrates with CDN. |
| Security | Cloud Armor | DDoS protection & WAF rules at the edge. |
min-instances: 0 (Dev), min-instances: 1 (Prod - to avoid cold starts).cpu-boost: true (Faster startup).concurrency: 80 (Ktor is async, can handle many concurrent requests per container).db-f1-micro (shared core) for Dev/Staging (~$10/mo).4 vCPU / 16GB RAM for Prod Primary.us-central1 primary, asia-south1 replica) to serve generic read traffic.{"url": "...", "jobId": "123"} to Pub/Sub.gcloud run deploy is a single command. CI/CD integration via Cloud Build is trivial.Dockerfile builds a lean JAR (done).