Ch 6 · Storage & Databases
Interaction risk
27 / 38

A database can run out of connections before it runs out of capacity.

Autoscaling the compute layer without pooling multiplies the exhaustion risk.

No pooling

50 instances × own connections → hits Cloud SQL's connection limit, well before CPU looks concerning

With pooling

A small, bounded pool of real connections shared across every instance

A read replica solves read-scaling, not analytical-query performance — two problems that look similar but have different fixes: more replicas vs. a different database product (AlloyDB). Pub/Sub deliberately sits between compute and storage, decoupling ingestion from wherever data eventually lands.