Prepare and test your skills
Prepare and test your skills
Compare Managed Services and Operational Control is the trade-off between letting Google Cloud run the platform and keeping direct control over servers and software. Fully managed serverless solutions maximize operational simplicity and speed to market, while infrastructure options maximize granular control over the operating system, hypervisor, and hardware. The choice depends on whether fast delivery or low-level tuning matters more.
Fully managed serverless options are Google Cloud platforms where Google manages servers, scaling, and availability while the customer deploys only code or containers. Requests flow from users or events to the Google-managed control plane, which allocates compute, runs the workload, and scales capacity up and down automatically. There are no servers, clusters, or operating systems for the customer to patch and maintain, so teams ship faster with less operational work.
Three serverless options divide this model by workload shape:
Choose a serverless option when automatic scaling and minimal operations matter more than control over the machine, kernel, or virtualization layer.
Bare Metal Solution (opens in a new tab) is a managed solution that provides purpose-built, sole-tenancy bare-metal servers for specialized workloads. The servers run in regional extensions connected to Google Cloud by a managed, high-performance connection with a low-latency network fabric. Traffic flows from the customer Virtual Private Cloud (VPC) through Partner Interconnect into the regional extension, where the dedicated servers reach Google Cloud services through private API access.
Ownership in Bare Metal Solution is split at the hardware boundary. Google Cloud owns facilities, power, network, physical and network security, hardware monitoring, and provisioning of custom servers with local SAN. Google Cloud installs the initial operating system or hypervisor, then hands control of the software stack to the customer. The customer then owns everything above the hardware:
Exam tip: Choose Bare Metal Solution when the workload needs third-party virtualization or direct hardware access; Google support focuses on infrastructure issues, not operating system, driver, or compatibility issues.
Choosing between simplicity and control means matching who manages servers and scaling to how much environment control the workload requires. Serverless platforms keep server management with Google Cloud, while Bare Metal Solution returns operating system and hypervisor control to the customer in exchange for greater management responsibility.
| Option | Who manages servers and scaling | Customer control |
|---|---|---|
| Cloud Run functions | Google Cloud manages all servers with zero server management | Customer controls only function code and event bindings |
| Cloud Run and App Engine | Google Cloud manages platform, scaling, and availability | Customer controls application code, container image, and service configuration |
| Bare Metal Solution | Google Cloud manages facilities, power, network, and hardware provisioning | Customer controls operating system, hypervisor, clusters, databases, patching, and licensing |
Use serverless for event-driven code, containerized services, and scalable web applications. Use Bare Metal Solution when the workload demands sole-tenancy hardware, custom hypervisors, or low-level tuning, and accept higher cost and complexity for patching, monitoring, and lifecycle operations.
Evaluate Cost, Performance, and Availability Trade-offs is the practice of choosing compute, storage, and location options that meet requirements without overspending. Higher availability and lower latency generally increase cost through extra replicas, wider geographic spread, and reserved capacity. Lower cost generally reduces resilience, so each choice must match how much downtime, delay, and management effort the workload can tolerate.
Compute Engine (opens in a new tab) provides virtual machines (VMs) with the most configuration flexibility, Google Kubernetes Engine (GKE) runs containerized applications with automated deployment and scaling, and Cloud Run runs workloads on a preconfigured serverless platform with minimal management. Traffic flows from users to the load balancer to VMs or containers that run the web and application tiers. Choose VMs or GKE when custom machine configuration matters, and choose Cloud Run when reducing infrastructure management matters more than fine-grained control.
Compute Engine costs can be tuned with machine type recommendations, custom machine types, and autoscaling. Machine type recommendations match VM size to observed usage, while custom machine types let teams provision CPU cores independently of memory for predictable workloads. Stateless managed instance groups (MIGs) add VMs when traffic rises and remove VMs when demand falls, which handles peaks gracefully and lowers cost when demand is low. Stateful MIGs cannot be autoscaled, so they do not provide the same cost benefit.
Spot VMs offer the same machine types, options, and performance as regular VMs at significantly lower cost, but Compute Engine can preemptively stop or delete Spot VMs to reclaim capacity. Spot VMs suit fault-tolerant web and application tiers and batch jobs that can tolerate preemption and do not have high availability requirements. When zone capacity is limited, MIGs using Spot VMs might not scale out to the target size until capacity returns, so critical tiers should use regular VMs with reservations for assured capacity.
Exam tip: Choose Spot VMs for fault-tolerant, preemptible work like batch jobs, not for tiers that require high availability or guaranteed scale-out.
Choosing storage and database classes means trading cost against durability, performance, and operational effort. Persistent Disk and Hyperdisk provide block storage for VMs with different trade-offs. Zonal Persistent Disk volumes keep data in one zone at lower cost, while regional Persistent Disk volumes and Hyperdisk Balanced High Availability replicate data synchronously between two zones in the same region to stay available during a single-zone outage. Hyperdisk Balanced provides better performance, flexibility, and efficiency than Persistent Disk because IOPS and throughput can be provisioned separately and changed dynamically.
Cloud Storage and Filestore provide object and shared file storage with location-based trade-offs. Data in regional buckets is replicated synchronously across zones in the region, while data in dual-region or multi-region buckets is stored redundantly in at least two geographic locations with metadata written synchronously and data replicated asynchronously. Data in a Filestore regional instance is replicated synchronously across three zones in a region for high availability, and a Filestore instance can be mounted on multiple VMs to share configuration files, tools, and logs.
Spanner (opens in a new tab) and Cloud SQL provide managed database options that trade operational effort for built-in availability. A multi-region Spanner instance stores four read-write replicas across two regions plus a witness replica in a third region, so application writes flow from application-tier VMs to Spanner replicas that stay synchronized across regions. Cloud SQL in high availability configuration fails over automatically from the primary database to the standby database without changing the database endpoint IP address. A self-managed database on Compute Engine VMs requires manual effort for updates, backups, and failover, plus an internal load balancer or observer to detect primary failure and redirect applications.
Deployment scope determines whether a zone outage or a region outage causes downtime and how recovery happens. A single-zone deployment keeps all VMs and disks in one zone for low latency and no cross-zone charges, but a zone outage takes the application down until it is restored from backups. A regional deployment spreads VMs across three zones with regional disks and load balancing, so the load balancer forwards requests from failed VMs to healthy VMs in another zone. A multi-region deployment runs active tiers in two or more regions with multi-region data services, so traffic can continue in the surviving region when an entire region fails.
Three side-by-side Google Cloud deployment scopes: a single-zone deployment with one zone of VMs and a zonal disk, a regional deployment with VMs spread across three zones behind a regional load balancer with synchronously replicated regional disks, and a multi-region deployment with a global load balancer serving two regions backed by a multi-region Spanner instance. Wider scope increases availability but also cost and complexity.
| Scope | Availability behavior | Cost profile | Choose when |
|---|---|---|---|
| Single-zone | Lost on zone outage, restored from backup | Lowest infrastructure and network cost | Development and testing, batch computing needing low-latency node links, or license-restricted software |
| Single-region | Survives zone outage, lost on region outage | Medium cost for cross-zone replicas and load balancing | Users in one geographic area needing zone resilience and low latency |
| Multi-region | Survives zone and region outages with active-active failover | Highest cost for cross-region replicas, transfer, and overprovisioning | Business-critical workloads that cannot tolerate regional downtime |
Wider scope costs more but avoids slow restoration from backups, which is why critical systems prefer regional resources over zonal resources and multi-regional resources over regional resources. In each region, using three zones rather than two and overprovisioning capacity by a third more than the estimate helps remaining zones absorb failover traffic. Eliminating single points of failure depends on redundant servers and databases, MIGs that recreate failed VMs, load balancing that distributes traffic evenly, and regional disks with synchronous replication.
Aggregate availability falls as more dependent tiers are chained together. The aggregate availability of chained tiers is tier1_availability x tier2_availability x tierN_availability, so four tiers at 99.9% each yield only about 99.6% overall. Parallel services yield higher availability through 1 - (1 - A) x (1 - B), so two 99% services in parallel yield 99.99% because each runs independently. Increasing from 99% to 99.9% cuts potential downtime from 864 seconds to 86 seconds per day, but each additional nine adds operational complexity and cost.
High availability (HA) and disaster recovery (DR) use different replication and recovery models. HA typically applies within a region through synchronous replication between zones, which supports zero or near-zero recovery time objective (RTO) and recovery point objective (RPO) in an active-active topology. DR typically applies across regions through asynchronous replication, which requires a defined replication strategy plus manual or semi-automated failover and careful assessment of RTO and RPO. Managed multi-regional services reduce manual recovery steps, while zonal or regional resources need snapshots in multi-region locations and tested replication to another region.
Balancing region selection means weighing latency and service availability against price, regulation, and sustainability limits. Choosing the region closest to users or on-premises systems lowers request latency, and keeping all resources in one region keeps traffic inside the region with low latency and no cross-region transfer charges. That benefit must be weighed against whether the region offers the required products, machine types, and quota.
Region decisions involve trade-offs across several competing factors:
A single-region choice can meet data residency rules, such as keeping European user data in a European region, while improving performance for users concentrated in one country. Multi-region and dual-region storage improve durability against regional loss, and turbo replication for dual-region buckets can shorten the replication RPO to 15 minutes, but wider replication increases storage and network cost. Place workloads near users for speed, replicate widely for resilience, and accept higher cost only where downtime or delay would violate business needs.
Analyze Data Consistency and Latency Requirements is the decision about how quickly every copy of data must agree and how quickly users around the world must get answers. Strong consistency keeps all replicas identical at write time but usually adds delay, while low-latency global access serves users from nearby locations but may allow replicas to differ briefly. In Google Cloud, this trade-off is controlled by where data is replicated, whether replication is synchronous or asynchronous, and where traffic is routed.
Synchronous replication within a region provides strong consistency with zero or near-zero RPO and RTO. High availability generally applies to regional deployments where managed services replicate synchronously between zones, which supports an active-active topology with no single point of failure. Because each write is confirmed on more than one zone before it completes, an application that reads after the write sees the same value even if one zone fails.
Regional Persistent Disk replicates block data synchronously between two zones in the same region, so a zonal outage does not lose acknowledged writes. Filestore regional instances replicate file data synchronously across three zones in a region, which keeps shared files available during a zone outage. Cloud Storage (opens in a new tab) regional buckets replicate object data synchronously across zones in the region for low-cost storage that stays consistent within that region.
The synchronous options share the same boundary rule:
Traffic that stays inside one region also avoids cross-region transfer cost and keeps network delay low between application components.
Latency-driven placement means putting the application and its data in the region closest to the users who need fast responses. A single-region deployment keeps requests, compute, and storage inside one geographic area, so user-perceived performance improves when all users are in that same country or area. Inter-resource traffic also remains within the region, which gives low-latency, high-bandwidth connections between web, application, and database tiers.
Cloud DNS distributes user traffic across regions, while load balancers direct each request to healthy capacity. A regional load balancer in each region keeps failover control separate by region, while a global load balancer can route users to the nearest healthy region automatically. Inside the private network, a cross-region internal load balancer can forward traffic from web-tier VMs in any region to application-tier VMs across all regions. Choosing between regional and global load balancing is a trade-off between isolation of failures and automatic global proximity routing.
Global scale with low-latency reads usually depends on asynchronous replication across regions, where the primary location acknowledges the write before distant replicas receive it. Disaster recovery generally applies to multi-region deployments without multi-regional services, so the replication strategy is typically asynchronous and requires planned failover steps. Because distant copies lag behind, the RPO is greater than zero and applications must tolerate brief inconsistency during replication and failover.
Cloud Storage dual-region and multi-region buckets store objects redundantly in at least two geographic locations for resilience against region outages. Metadata is written synchronously across regions, while object data is replicated asynchronously between regions. With turbo replication for dual-region buckets, objects are replicated across the region pair with an RPO of 15 minutes. This pattern gives durable global access with lower write latency than waiting for full confirmation in every region.
Spanner (opens in a new tab) is the exception that combines global distribution with strong consistency through built-in synchronization across regions. A Spanner multi-region instance uses four read-write replicas in separate zones across two regions plus a witness replica in a third region. Application writes flow to the Spanner instance and reads return globally consistent relational data without restoring from backups. Cloud SQL in high availability configuration provides a near active-active topology with read replicas across zones and an RPO between regions that is close to 0, but failover of a self-managed primary still needs an observer, failover rules, and protection against split-brain.
Choosing a storage pattern means matching the replication boundary to whether the workload needs identical data everywhere or the fastest nearby answer. The boundary defines which copies confirm a write before it completes and how far a read must travel. Stronger consistency and wider distribution both add cost and complexity.
| Option | Replication boundary | Consistency and RPO |
|---|---|---|
| Spanner multi-region instance | Four read-write replicas across two regions plus witness in third region | Globally consistent reads and writes with built-in synchronization |
| Cloud SQL in HA configuration | Primary with standby and read replicas across zones, near active-active between regions | Automatic failover with RPO close to 0, endpoint address does not change |
| Cloud Storage regional bucket | Synchronous replication across zones in one region | Strong within-region consistency, no cross-region lag |
| Cloud Storage dual-region or multi-region bucket | Metadata synchronous across regions, data asynchronous across regions | Eventual data consistency across regions, RPO of 15 minutes with turbo replication |
Use Spanner when financial transactions or inventory must be identical for users in multiple regions at the same time. Use Cloud SQL high availability when a relational workload needs automatic zonal failover and very low data loss with simpler operations. Use regional buckets when objects must stay consistent and low-latency inside one region. Use dual-region or multi-region buckets when objects must survive a region outage and global read access matters more than immediate consistency.
Exam tip: Choose Spanner for globally consistent relational data across regions, while Cloud Storage dual-region buckets with turbo replication mean metadata is synchronous but object data lags with a 15-minute RPO.
Use Bare Metal Solution when the workload demands sole-tenancy hardware, custom hypervisors, third-party virtualization, or direct hardware access and you can accept greater management responsibility for the operating system, hypervisor, patching, databases, and licensing. Use App Engine, Cloud Run, or Cloud Run functions when automatic scaling and minimal operations matter more than control over the machine, kernel, or virtualization layer, such as for event-driven code, containerized services, and scalable web applications.
Use Spot VMs for fault-tolerant web and application tiers and batch jobs that can tolerate preemption and do not have high availability requirements because they offer the same machine types, options, and performance as regular VMs at significantly lower cost but can be preemptively stopped or deleted. Use regular VMs with reservations for critical tiers that require high availability or guaranteed scale-out because managed instance groups using Spot VMs might not scale out to the target size when zone capacity is limited.
Use a Spanner multi-region instance when relational data such as financial transactions or inventory must be identical for users in multiple regions at the same time because it uses four read-write replicas across two regions plus a witness replica in a third region to provide globally consistent reads and writes. Use Cloud Storage dual-region or multi-region buckets when objects must survive a region outage and global read access matters more than immediate consistency because metadata is written synchronously across regions while object data is replicated asynchronously, with turbo replication providing a 15-minute recovery point objective.
A global gaming company is architecting a low-latency caching and state store on Google Cloud to handle millions of active sessions. The engineering team requires horizontal write scalability across multiple shards and needs to scale out read throughput across multiple zones while maintaining minimal client response times.
The team decides to deploy Memorystore for Redis Cluster (or Memorystore for Valkey) in Cluster Mode Enabled with read replicas provisioned for each shard, configuring client connections to issue the READONLY command to read directly from replica nodes.
According to distributed systems design trade-offs and the CAP theorem, what architectural trade-off must the team accept with this configuration?
Every read request automatically acquires a pessimistic lock on the underlying hash slot across the cluster, causing high transaction contention under heavy traffic.
Cluster scaling requires freezing all active primary nodes and draining client connection pools, preventing any write operations during shard rebalancing.
Read operations directed to replica nodes may return stale data due to asynchronous replication, and acknowledged writes can be lost during an unplanned failover.
Write operations will require a synchronous two-phase commit across all shard replicas, leading to increased write latency and blocking during cross-zone network partitions.
Last updated