Zen Algorithms · Insurance Lab ← Architecture
Backend · Google Cloud

GCP Topology

Two production deployment profiles: Profile A · Elastic-Serverless (managed containers + managed Postgres — Google runs the servers and the database) fits the bursty, seasonal nature of quote traffic (idle most of the day, spikes after a marketing push) with minimal ops; Profile B · High-Scale Transactional & Analytics (orchestrated compute (a Kubernetes cluster — GKE) + HTAP Postgres) is for sustained transactional load and heavy read fan-out. Both speak the same Postgres interface (identical SQL), so moving A→B is non-breaking — a scaling decision, not a rewrite.

Layer guide (click any term): serverless · Cloud Run · ingress · load balancer · NEG · CDN · OLTP · AlloyDB · columnar · Pub/Sub · connection pooler · Secret Manager.

Request path: Vercel → global edge → per-flow services → data / AI / async
GCP topology in lanes: ingress, compute, data, AI, async, and cross-cutting. Region (US / EU / Asia — one Terraform module each) Ingress Global HTTPS LB + serverless NEG + CDN? Compute Cloud Run (A) / +GKE (B)? BFF / API edge? Data Cloud SQL (A) / AlloyDB (B)? BigQuery? Cloud Storage + Bucket Lock? AI Vertex AI — Gemini / embeddings? Vector Search (A) / AlloyDB pgvector (B)? Async Pub/Sub + Cloud Tasks (install gate)? Secret Manager? Cloud Run blue/green?
store object / external click any box for its definition
LayerChoiceWhy
Compute Cloud Run (scale-to-zero: costs nothing while idle)GKE Autopilot + Cloud Run edge lowest ops; matches bursty/seasonal quote loadhosting ML models + long-running background jobs
OLTP Cloud SQL Postgres 15 (HA — high availability, PITR)AlloyDB (HTAP, columnar) portable, cheapheavy read fan-out / operational analytics at scale
RAG vectors Vertex Vector SearchAlloyDB pgvector (co-located) managed scalevectors live beside policy rows — one database for joins + audit
AnalyticsBigQuery (both)actuaries build rates here; results are copied to the live database so the hot path never waits