Google Cloud SQL
Google Cloud SQL is a fully-managed MySQL, PostgreSQL and SQL Server database service that is built on the strength and reliability of Google's infrastructure.
- Up to 10 TB storage, 25000 IOPs, 208GB RAM, 32 processors core per instance.
- Not a replacement for a standalone SQL database (it doesn't offer DBA features like SQL optimization).
- Accessible from any application, anywhere.
- Affordable, no commitment pricing for any size applications.
- Vanilla community versions.
- Structured, relational with horizontal scalability only on a single node (unlike Cloud Spanner).
- It allows access to database instance with GCP.
- It automates backups, patches, applications and upgrades.
- Data encrypted at rest.
- It supports SSL with Cloud SQL Proxy.
- Availability 99,95% anywhere in the world.
The parametrization of database is performed through SQL flags.
The high availability cluster provides data redundancy.
Active-Pasive: primary instance (master) in primary zone and a failover replica in secondary zone (both in same region).
Data is kept in sync between instance via semisynchronous replication.
Failover is iniciated if primary instance is unresponsive for approximately 60 seconds, or primary zone experiences an outage.
If replication lag is over 10 minutes, Cloud SQL will not initiate a failover automatically.
Daily automatic backups can be setup, specifying a backup window.
Backups are snapshots at block level, rather than data dumps (very little performance overhead).
Rolly backups: available for 7 days by default.
Restore to a 24 hour time sliced, using a backup.
Point-in-time recovery (only for MySQL), thanks to binary logging.
Performance: Read Replicas
Create read replicas to offload read operations from master DB instance:
- It prevent few applications from dominating access to reads.
- It prevent analytics to interfere with transactions.
- Good for reports, large read only queries.
Some statements are not supported
Cloud SQL Proxy
It provides secure access (through a TCP secure tunnel, with TLS and SSL certificates) to Cloud SQL instances without having to whitelist IP addresses or configure SSL.
It is based on a proxy client on the client machine (accessible via local connection), the secured tunnel, and a proxy server, part of Cloud SQL service, conecting to database instance.
It is good for web frameworks, structured data and OLTP workloads:
- Websites, blogs, and content management systems (CMS)
- Business Intelligence (BI) applications
- ERP, CRM, and eCommerce applications
- Geospatial applications