Google Cloud SQL
Google Cloud SQL is the relational database service for teams that want to keep MySQL, PostgreSQL, or SQL Server semantics without personally handling patching, backups, and replica operations. It becomes the default home for transaction-heavy application data when SQL familiarity matters more than database administration.
▶Architecture Diagram
🔍 StructureDashed line animations indicate the flow direction of data or requests
Installing a relational database on a VM means you're responsible for security patches, backup scripts, replication setup, and disk capacity management. When the database crashes at 3 AM, it's the operator who gets paged.
Relational databases have been around for decades, but each instance needed hands-on care: patching, backup verification, replication tuning, failover testing. As web applications scaled, a single DBA might be responsible for dozens of MySQL or PostgreSQL instances across teams. Patch cycles slipped, backup restores went untested for months, and when a primary failed at 3 AM the on-call engineer was debugging replication lag instead of sleeping. The operational cost of running reliable databases grew faster than headcount, which pushed the industry toward managed services that absorbed those tasks into the platform itself.
Applications send SQL queries to a Cloud SQL endpoint while the service operates the database instance behind it. The service captures a continuous binary log of every write, which enables point-in-time recovery to any second within the retention window — not just to the last scheduled snapshot. High availability relies on a standby replica that receives the same write stream in near-real-time; when the primary fails, the standby promotes in seconds because it already has an up-to-date copy of the data. Read replicas absorb read traffic so the primary can stay focused on write transactions, and patching happens on a maintenance window the operator chooses rather than through manual SSH sessions.
Cloud SQL and Cloud Spanner are both relational databases, but Cloud SQL is single-region MySQL/PostgreSQL while Spanner is globally distributed. For typical web apps processing transactions in one region, Cloud SQL is the right fit — only consider Spanner when you need globally consistent transactions.
Best for web app CRUD, order/payment transactions, and migrating existing MySQL/PostgreSQL apps to the cloud. Not ideal when you need unlimited horizontal scaling or global distribution.