Courseiva
PCDEChapter 2 of 18Objective 1.2

Cloud SQL Fundamentals: Provisioning and Configuring Managed Relational Databases

What is the single biggest headache for anyone learning to run databases in the cloud? It is the time and complexity of managing the underlying server yourself. Cloud SQL solves this by letting you provision and configure a fully managed relational database in minutes instead of days. For the PCDE exam, understanding how to set up Cloud SQL instances for MySQL, PostgreSQL, and SQL Server is fundamental because Google Cloud tests your ability to choose the right configuration options for performance, high availability, and cost without getting lost in server management details.

12 min read
Beginner
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Cloud SQL Fundamentals: Provisioning and Configuring Managed Relational Databases

The Personal Chef Analogy

Why do restaurants with dozens of tables need someone to manage the kitchen instead of just hiring more cooks?

Imagine you decide to open a restaurant. At first, you cook everything yourself. You buy ingredients, wash them, chop them, and cook each dish. This works when you serve just a few friends. But soon customers line up. You cannot keep up. You hire a cook. Now you must buy a bigger stove, more pots, and a fridge that does not break. You also need to clean the kitchen, check if the cook is doing well, and plan what to cook tomorrow. Running the kitchen is taking more time than actually cooking.

Cloud SQL is like hiring a professional kitchen manager. You still tell the manager what dishes to make (your database schema and queries). But the manager handles everything else: buying the right stove (provisioning the right machine size), keeping the fridge temperature perfect (automated backups), replacing a broken oven instantly (failover to a replica), and making sure the kitchen never runs out of popular ingredients (storage scaling). You do not need to know how to repair a fridge or negotiate with vegetable vendors. You just focus on making the dishes taste great. In the old way (self-managed databases), you had to install database software, apply security patches, buy more hard drives when you ran out of space, and rebuild everything if the server crashed. With Cloud SQL, the kitchen manager—Google—takes care of all that busy work so you can focus on your recipes (your data).

How It Actually Works

Cloud SQL is a fully managed database service offered by Google Cloud. It supports three popular database engines: MySQL, PostgreSQL, and SQL Server. 'Fully managed' means Google takes care of the underlying infrastructure for you. You do not need to install the database software, apply security patches, or monitor the health of the physical server. You simply define what you want, and Cloud SQL creates it.

To understand Cloud SQL, you first need to know what a relational database is. A relational database stores data in tables with rows and columns, similar to a spreadsheet. Each table has a fixed structure, like a contact list with columns for name, phone number, and email address. You use a language called SQL (Structured Query Language) to ask questions of your data, such as 'find all customers who live in London'. MySQL, PostgreSQL, and SQL Server are different brands of relational database software. Each has its own strengths, but they all speak SQL.

Now, what does provisioning a Cloud SQL instance actually mean? Provisioning is the process of creating a new database instance in the cloud. You choose the database engine (MySQL, PostgreSQL, or SQL Server), the version (for example, MySQL 8.0), the region where the data should be stored (like europe-west1 in Belgium), and the machine configuration. The machine configuration defines how much computing power and memory your database gets. Google Cloud offers different tiers: db-f1-micro and db-g1-small for small testing workloads, and standard and high-memory machine types for production.

Configuration goes beyond just picking a machine size. You also decide on storage type and capacity. Cloud SQL offers two storage options: SSD (solid-state drive) for fast performance and HDD (hard disk drive) for lower cost. You can set a storage capacity in gigabytes, and Cloud SQL automatically increases storage up to a limit you define. This is called automatic storage increase and is a key feature for avoiding unexpected out-of-space errors.

Another critical configuration choice is 'high availability' (HA). If the physical machine running your database fails, without HA your database becomes unavailable until someone manually restores it. With HA, Cloud SQL creates a standby instance in a different zone within the same region. If the primary zone fails, traffic automatically switches to the standby within seconds. You also configure backups. Cloud SQL can automatically take daily backups and store them for up to 365 days. You can also enable point-in-time recovery, which lets you restore your database to any moment within the last seven days.

Networking is another part of configuration. By default, your Cloud SQL instance is accessible only from within your Google Cloud project. You can allow specific IP addresses through authorised networks, or use a dedicated private connection via VPC (Virtual Private Cloud) peering. Authentication happens through Google Cloud IAM (Identity and Access Management) or database-native usernames and passwords. SSL/TLS encryption can be enforced to protect data in transit.

Finally, you must consider maintenance. Cloud SQL automatically applies security patches and minor version updates during a configurable maintenance window. You can define a one-hour window each week for these updates, minimising disruption to your application.

All these options (region, machine type, storage, HA, backups, networking, maintenance) are defined at creation time or can be modified later. The Google Cloud Console (web interface), gcloud command-line tool, or API (application programming interface) can be used to provision and configure instances. For the PCDE exam, you should understand how each configuration choice affects performance, availability, and cost.

This flowchart shows the decision path from user request to a fully configured Cloud SQL instance, highlighting engine choice, HA, and configuration steps.

Walk-Through

1

Choose Database Engine and Version

Select MySQL, PostgreSQL, or SQL Server, and specify the exact version (e.g., MySQL 8.0). The choice depends on application compatibility and feature requirements. The exam tests that you know which engines support cross-region replicas.

2

Select Region and Zone Configuration

Pick a region (e.g., us-central1) and optionally a primary and secondary zone if enabling HA. This determines data location for latency and compliance. The PCDE expects you to understand that HA requires two zones in the same region.

3

Define Machine Tier and Storage

Choose a machine type (db-f1-micro for testing, or custom vCPU/memory for production). Set storage type (SSD or HDD), initial size in GB, and enable automatic storage increase. Configuration affects cost and query performance.

4

Configure High Availability and Backups

Enable HA for automatic failover. Set automated daily backups and retention period (1-365 days). Optionally enable point-in-time recovery. Backup settings are critical for disaster recovery scenarios tested on the PCDE.

5

Set Networking and Authentication

Authorise external IP addresses via authorised networks or use Private IP with VPC peering. Choose between IAM-based or database-native authentication. This step ensures secure connectivity, a common exam scenario.

6

Specify Database Flags and Maintenance Window

Adjust database parameters (flags) like max_connections. Set a preferred maintenance window for automatic updates. Flags are engine-specific; not all parameters are available compared to self-managed instances.

7

Create the Instance and Verify Connectivity

Provision the instance via Console, gcloud, or API. After creation, connect using a SQL client to verify the instance works. Document the connection string, IP address, and credentials for team use.

What This Looks Like on the Job

Imagine you are a database engineer working for a growing e-commerce company called 'ShopFast'. ShopFast sells shoes online. The company has a monolithic application that stores all customer orders, product inventory, and user accounts in a single MySQL database running on a laptop under someone's desk. This has become unreliable. Orders are lost when the laptop overheats, and the company cannot afford downtime during the holiday sales season.

Your manager asks you to move the database to Google Cloud using Cloud SQL. Here is what you actually do as an IT professional, step by step:

First, you assess the current database. You identify that ShopFast uses MySQL 5.7 and the database size is 50 GB. You check that no features used by the application are incompatible with Cloud SQL (for example, any custom MySQL plugins not supported by Cloud SQL).

Next, you plan the Cloud SQL instance. You pick a region close to your users, for example us-central1 (Iowa). Since ShopFast is growing, you choose a standard machine type with 4 vCPUs and 15 GB of memory to start. You select SSD storage for fast reads and writes. You enable automatic storage increase up to 500 GB. For high availability, you enable HA zone redundancy because losing orders is not acceptable. You set daily backups at 2 AM UTC with a 30-day retention period, and you enable point-in-time recovery.

You then create the instance using the Google Cloud Console. You name it 'shopfast-prod-db'. You configure authorised networks: you add the IP addresses of the application server and the office VPN. You also create a separate user account for the application with limited privileges (only SELECT, INSERT, UPDATE, DELETE on the shop database) for security. You do not use the default root account for the app.

With the empty Cloud SQL instance running, you now need to migrate the existing data. For a 50 GB MySQL database, you use the mysqldump tool to export the data from the old laptop, then import it into Cloud SQL using the mysql command-line client. You schedule this migration during a low-traffic period, such as a Saturday morning. You test the import on a separate staging instance first to verify everything works.

After migration, you update the application configuration to point to the Cloud SQL instance's public IP address and new credentials. You test the application thoroughly. Finally, you set up monitoring using Cloud Monitoring and Cloud Logging to track query performance, CPU usage, and storage utilisation. You also create an alert if CPU usage exceeds 80% for more than 5 minutes, so you can scale up before users notice slowness.

Throughout this process, you document every configuration choice for the team. Six months later, when a hardware failure occurs in one of the zones in us-central1, the application does not even blink—Cloud SQL's HA failover switches to the standby instance, and users continue shopping. That is the real-world power of Cloud SQL.

How PCDE Actually Tests This

The PCDE exam tests your ability to design and configure Cloud SQL instances—not just recognise console buttons. The official objective 1.2 is 'Provision and configure Cloud SQL instances (MySQL, PostgreSQL, SQL Server)'. Expect questions that present a business scenario and ask you to choose the right configuration.

Common exam topics include:

Differences between Cloud SQL and Cloud Spanner (Cloud SQL is for smaller, regional workloads; Cloud Spanner is for globally distributed, strongly consistent databases).

How to enable high availability. The exam loves testing that HA requires two zones in the same region and that failover is automatic but not instantaneous (typically under 60 seconds).

Storage options: SSD vs HDD. SSD is recommended for most production workloads. HDD is cheaper but slower. Automatic storage increase is enabled by default but configurable.

Backups and point-in-time recovery: automated daily backups are enabled by default. You can configure retention (max 365 days). Point-in-time recovery needs binary logging enabled and logs stored for up to 7 days.

Authorised networks vs Private IP. The exam tests that authorised networks are simple but less secure, while Private IP using VPC peering is recommended for production because traffic stays within Google's network.

Maintenance windows: you can set a preferred window for updates. You cannot opt out entirely. Maintenance happens even if you do not set a window, but it will be at a random time.

Database flags: Cloud SQL allows setting certain database configuration parameters using flags, e.g., max_connections for MySQL or work_mem for PostgreSQL. Not all flags are available compared to a self-managed instance.

Trap patterns to watch for: - 'Which service is best for a globally distributed application?' The answer is Cloud Spanner, not Cloud SQL. Cloud SQL is regional. - 'Can I use Cloud SQL with SQL Server Authentication mode?' Yes, but Cloud SQL for SQL Server supports both Windows Authentication and SQL Server Authentication. - 'Is there free tier for Cloud SQL?' No, Cloud SQL does not have an always-free tier. It has a 90-day free trial with $300 credit. - 'Can I change the machine type after creation?' Yes, you can scale vertically (more vCPUs/memory) with minimal downtime. - 'Does Cloud SQL support read replicas?' Yes, for all three engines, for scaling read traffic. Cross-region replicas are supported for MySQL and PostgreSQL, but not SQL Server.

Key definitions to memorise:

Cloud SQL: fully managed relational database service for MySQL, PostgreSQL, SQL Server.

High availability (HA): a configuration where a standby instance in a different zone automatically takes over if the primary fails.

Point-in-time recovery (PITR): ability to restore a database to any specific time within a retention window (default 7 days).

Authorised networks: a list of IP addresses or ranges that are allowed to connect to the instance.

VPC peering: private network connection between your VPC and Cloud SQL's service network.

The exam questions often present a scenario like: 'A company needs a database for a CRM application. The database must be highly available and store data in the United States. Which configuration should you choose?' The correct answer will include selecting the appropriate engine (usually MySQL or PostgreSQL), enabling HA, choosing a US region, and configuring authorised networks or Private IP.

Key Takeaways

Cloud SQL is a fully managed PaaS that supports MySQL, PostgreSQL, and SQL Server, freeing you from server maintenance tasks like patching and backups.

High availability (HA) creates a standby instance in a different zone within the same region and provides automatic failover typically under 60 seconds.

Point-in-time recovery (PITR) allows you to restore your database to any moment within the last 7 days, requiring binary logging to be enabled.

Automatic storage increase is enabled by default, but you can set a maximum storage limit to control costs and prevent unbounded growth.

Authorised networks allow IP-based access but are less secure than using Private IP with VPC peering for production environments.

Cloud SQL is a regional service; you cannot deploy a single primary instance across multiple regions, unlike Cloud Spanner.

You can vertically scale a Cloud SQL instance (increase vCPUs and memory) with minimal downtime, usually under a few minutes.

Maintenance windows can be configured to a specific one-hour weekly slot; if not set, updates occur at a random time.

Cross-region read replicas are supported for MySQL and PostgreSQL, but not for SQL Server.

Cloud SQL does not offer an always-free tier, but new users receive $300 in free credits for the first 90 days.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Cloud SQL (MySQL)

Uses MySQL syntax and features like stored procedures in MySQL dialect

Supports cross-region read replicas

Commonly used for web applications and LAMP stacks

Cloud SQL (PostgreSQL)

Uses PostgreSQL syntax with advanced features like JSONB and custom data types

Also supports cross-region read replicas

Preferred for applications needing advanced analytics, geospatial data, or strict ACID compliance

High Availability (HA)

Provides automatic failover to a standby instance in a different zone

Standby is kept synchronously with the primary; no data loss in failover

Purpose is to increase availability and reduce downtime during zone failures

Read Replicas

Creates one or more read-only copies of the primary instance

Replicas are asynchronous; there may be a few seconds of lag

Purpose is to offload read queries and improve performance for read-heavy workloads

Public IP (Authorised Networks)

Instance is accessible over the internet via an ephemeral or static public IP

Access is controlled by IP allowlists (authorised networks)

Less secure because traffic traverses the public internet

Private IP (VPC Peering)

Instance is accessible only within your VPC network via internal IP

No exposure to the public internet, reducing attack surface

Recommended for production environments for better security and lower latency

Automated Backups

Daily full backup of the instance, stored for 1-365 days

Restores to the most recent backup time

Does not require binary logging to be enabled

Point-in-Time Recovery (PITR)

Uses transaction logs to restore to any specific time within a window (default 7 days)

Provides finer granularity than full backups

Requires binary logging to be enabled on the instance

Cloud SQL

PaaS: Google manages OS, database software, patches, backups, and replication

You cannot SSH into the underlying server; limited control over database configuration

Simpler to set up and maintain; less administrative overhead

Compute Engine (Self-Managed DB)

IaaS: You manage everything from OS to database software

Full root access; can install any database version or custom configuration

More flexible but requires significant operational effort for patching, monitoring, and failover

Watch Out for These

Mistake

Cloud SQL is the same as running a MySQL server on a Compute Engine virtual machine (VM).

Correct

Cloud SQL is a PaaS (Platform as a Service) where Google manages the OS, database software, patches, and replication. A VM gives you full control but you must manage everything yourself, including backups and failover.

Beginners see 'MySQL' in the name and assume it is just a managed MySQL installation, not understanding the fundamental difference in management responsibility between IaaS (Compute Engine) and PaaS (Cloud SQL).

Mistake

You cannot use Cloud SQL for any application that needs more than 10 TB of storage.

Correct

Cloud SQL supports up to 30 TB of storage per instance for MySQL and PostgreSQL, and up to 30 TB for SQL Server (depending on the edition). There is also automatic storage increase.

Users often assume 'fully managed' means 'limited to small workloads'. The storage limits are actually quite generous, but beginners confuse Cloud SQL with lightweight services like Firebase.

Mistake

Enabling high availability guarantees zero downtime during failover.

Correct

HA minimises but does not eliminate downtime. Failover typically takes under 60 seconds, during which existing connections are dropped. Application-level retry logic is still required.

The word 'automatic' in documentation leads beginners to assume failover is instant and seamless, when in practice there is a brief connection interrupt.

Mistake

You can create a Cloud SQL instance in any Google Cloud region, including multi-region locations like 'nam4' or 'eur4'.

Correct

Cloud SQL is a regional service. You pick a specific region like us-central1 or europe-west1. You cannot deploy a single Cloud SQL instance across multiple regions like Cloud Spanner. Multi-region placement only applies to read replicas, not the primary instance.

Beginners confuse Cloud SQL with Google's globally distributed database services (Cloud Spanner, Bigtable). The word 'regional' is often missed in documentation.

Mistake

Cloud SQL for SQL Server supports cross-region replicas just like MySQL and PostgreSQL.

Correct

Cloud SQL for SQL Server does not support cross-region replicas. Only same-region replicas are available for SQL Server. Cross-region replicas are supported for MySQL and PostgreSQL.

Candidates assume the feature set is identical across all three database engines because the service is called 'Cloud SQL'. But Microsoft's licensing restrictions limit cross-region replication for SQL Server.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

Can I change the machine type of a Cloud SQL instance after it is created?

Yes, you can vertically scale a Cloud SQL instance by editing the instance and selecting a new machine type. This typically causes under a minute of downtime.

What is the difference between Cloud SQL and Cloud Spanner?

Cloud SQL is a regional, fully managed relational database for MySQL, PostgreSQL, and SQL Server. Cloud Spanner is a globally distributed, strongly consistent database service that spans multiple regions.

Does Cloud SQL support automatic failover?

Yes, if you configure high availability (HA), Cloud SQL automatically fails over to a standby instance in a different zone within the same region when the primary zone experiences an outage.

Can I use my existing database license for SQL Server in Cloud SQL?

Cloud SQL for SQL Server includes the license cost in the instance pricing. You cannot bring your own SQL Server license; you must use the license provided by Google Cloud.

How are backups stored in Cloud SQL?

Automated daily backups and on-demand backups are stored in Google Cloud Storage, encrypted at rest. You can configure retention up to 365 days and enable point-in-time recovery.

Is there a free tier for Cloud SQL?

No, Cloud SQL does not have an always-free tier. However, new Google Cloud customers receive $300 in free credits to use on any service, including Cloud SQL, for the first 90 days.

Can I connect to my Cloud SQL instance using only private IP?

Yes, Cloud SQL supports Private IP connectivity using VPC peering or a private services access connection. This is recommended for production to avoid exposing your database over the public internet.

Terms Worth Knowing

Keep going

You've finished Cloud SQL Fundamentals: Provisioning and Configuring Managed Relational Databases. Continue through the PCDE study guide to build a complete picture of the exam.

Done with this chapter?