Sangeetha-Grantha

Metadata Value
Status Active
Version 1.1.0
Last Updated 2026-09-10
Author Sangeetha Grantha Team
Document Type Design reference

Google Cloud Scaling Strategy (Cost-Effective, Global)


[!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: Proposal | Version: 1.0 | Date: 2026-01-14
Scope: Google Cloud deployment architecture for scaling Sangeetha Grantha to millions of global users
Related: Scaling Evaluation, Tech Stack, Backend Architecture

1. Goals & Constraints

Goals

Constraints / Current Assumptions


2.1 High-Level Diagram (Phase 1–2 Target)

Users (Global)
   |
   |  HTTPS
   v
Cloud Load Balancing (Global External HTTP(S))
   |\
   | \__ Cloud CDN (static + cacheable public API)
   |
   v
API Gateway (optional) / Cloud Run (direct)  ---- Cloud Armor (WAF + rate limits)
   |
   v
Cloud Run (Ktor containers, multi-instance autoscaling)
   |
   +--> Memorystore (Redis)  (read caches, rate-limit counters, optional sessions)
   |
   +--> Cloud SQL for PostgreSQL (primary, HA)
          +--> Read replica(s) (same region)   [Phase 2]
          +--> Cross-region replica (DR)       [Phase 3]
   |
   +--> Pub/Sub / Cloud Tasks (async jobs)     [Phase 2–3]
          +--> Cloud Run worker(s)
                 +--> Vertex AI (Gemini) for AI tasks

Admin Web (React)
   |
   v
Cloud Storage (static hosting) -> Cloud CDN -> (optional) IAP/Identity-Aware controls

2.2 Why this is cost-effective


3. Service-by-Service Recommendations (What to use, and why)

3.1 Compute: Cloud Run (default)

Use Cloud Run for the Ktor backend (containerized).

When to consider GKE:

3.2 Database: Cloud SQL for PostgreSQL (HA + replicas)

Use Cloud SQL Postgres for primary OLTP storage.

Connection management (critical for Cloud Run):

When to consider AlloyDB / Spanner:

3.3 Caching: Memorystore (Redis)

Use Memorystore for Redis as the first scaling lever.

3.4 Edge + Static: Cloud Storage + Cloud CDN

Host the React admin web build in Cloud Storage and serve via Cloud CDN.

3.5 API front door: Global Load Balancer (+ optional API Gateway)

Two good patterns:

For admin APIs, consider keeping them on a separate hostname (e.g., admin-api.*) so you can apply stricter policies.

3.6 DDoS/WAF/rate limiting: Cloud Armor

Use Cloud Armor at the edge for:

This prevents expensive origin and DB work for abusive traffic.

3.7 Async processing: Pub/Sub + Cloud Tasks (+ Cloud Scheduler)

Move AI and heavy workflows off the request path.

Worker runtime: Cloud Run services (or Cloud Run Jobs for batch) that consume Pub/Sub or Tasks.

3.8 Search: staged approach

Search is usually the first feature that breaks at global scale; treat it as its own subsystem.

3.9 AI: Vertex AI (Gemini) + async execution

Use Vertex AI Gemini instead of direct outbound calls from the request path.

3.10 Observability: Cloud Operations suite + OpenTelemetry

Adopt Google Cloud’s observability stack early:


4. Cost Levers (Practical tactics)

4.1 Reduce database spend first (highest impact)

4.2 Control Cloud SQL connection pressure

4.3 Control egress and origin compute

4.4 Avoid “always-on” heavy platforms early


5. Phased Roadmap (GCP-specific)

Phase 1 — Foundation (Weeks 1–6)

Expected impact: major reduction in DB load and origin compute, global latency improvement from CDN.

Phase 2 — Scale Reads & Search (Months 2–4)

Expected impact: sustained search performance and predictable scaling under high read concurrency.

Phase 3 — Global Reliability (Months 4–8)

Expected impact: resilient global platform that can withstand regional incidents and large traffic spikes.


6. Key Design Changes to Make in the Application (Cloud-agnostic but GCP-motivated)

6.1 Cacheability and edge-friendliness

6.2 Split read models from write models

For global scale, treat these separately:

6.3 Async-first AI and import workloads

6.4 Rate limiting and abuse protection


7. Concrete “First Deployment” Recommendation (minimal, production-viable)

If starting today on GCP, the most cost-effective, scalable baseline is:

Then add: read replicas, Pub/Sub workers, and dedicated search as traffic grows.


Section index · Documentation home · Feature status