Learning Objectives
By the end of this chapter, you will be able to:
- Determine database connectivity and access management
- Configure database monitoring and troubleshooting options
- Design database backup and recovery solutions
- Optimize database cost and performance
- Determine solutions to automate database tasks
Executive Summary
- IAM policies bound at project, instance, database, and (where supported) table or row level decide who can connect and what they can do, while database-engine roles continue to govern in-engine privileges in Cloud SQL and AlloyDB.
- Query Insights, the Spanner query stats tables, the AlloyDB Index Advisor, and Cloud Monitoring vitals together form the troubleshooting surface that diagnoses slow queries, locking, missing indexes, and resource contention.
- Backup design begins from an SLA and an SLO, decomposes them into RTO and RPO targets, and then maps those targets to automated backups, continuous backup, PITR windows, and exports across each engine.
- Scaling decisions weigh vertical resize against horizontal read replicas, AlloyDB read pool nodes, Spanner processing units, and Bigtable cluster expansion, with cost controlled through committed use discounts, right-sizing, and tier selection.
- Automation moves recurring jobs (index rebuilds, vacuum, fragmentation control, export rotation) off DBA hands and into Cloud Scheduler, Workflows, and Cloud Run jobs invoked through service accounts with least-privilege roles.
Assumptions
- The reader holds the design vocabulary established in Chapter 1, including processing units, Cloud SQL Enterprise Plus, Hyperdisk Balanced, AlloyDB columnar engine, ScaNN index, Private Service Connect, and CMEK; those terms are not re-defined here.
- All commands assume
gcloudinitialized against a target project with billing linked, and operations honor organization policies that may pin region, key custody, and public IP exposure. - Where multi-region postures appear, the discussion presumes the engineer already chose between Spanner multi-region, AlloyDB regional with cross-region secondary, or Cloud SQL HA plus cross-region read replica in the design phase.
