Prepare and test your skills
Prepare and test your skills
Distributed load testing and performance benchmarking is the practice of simulating massive user concurrency to validate autoscaling, find resource bottlenecks, and prove an architecture meets its Service Level Objectives (SLOs). In Google Cloud, behavior under stress is determined by how Cloud Load Balancing (opens in a new tab) distributes traffic, how backends scale and recover, how rate limits contain overload, and which network path traffic takes to reach global backends.
Validating autoscaling means checking application responsiveness, not just infrastructure size. Autoscaling adds infrastructure resources to handle current load, but an application can still be unresponsive when sufficient resources exist. For example, all virtual machines (VMs) that host the application might be in the RUNNING state while the application software on some VMs has crashed.
Load-balancing health checks ensure that load balancers route application traffic only to backends that are responsive. If the backends are managed instance groups (MIGs) (opens in a new tab), an extra layer of health checks can autoheal unavailable VMs. When autohealing is configured for a MIG, the unavailable VMs are proactively deleted and new VMs are created. A load test therefore must measure successful responses and latency against SLOs while autoscaling, health-check failures, and autohealing occur together.
Distributing stress across tiers and regions means benchmarking both external and internal load-balancing paths under load. Load balancing under stress improves reliability by routing traffic only to available resources and by ensuring that individual resources are not overloaded. In a 3-tier web application stack, an internal load balancer provides reliable communication between the web and app tiers, so a complete test must stress traffic between tiers as well as traffic between external clients and the application.
In a global topology, traffic flows from internet clients to web servers to application servers to the database in order. A global external load balancer distributes incoming requests to web servers in appropriate regions based on their availability, capacity, and proximity to the source of traffic. Traffic then flows from the web-tier VMs through a cross-regional internal load balancing layer to the application-tier VMs across all regions based on their availability and capacity. The application servers then write data to, and read data from, a synchronously replicated database that is available in all regions, such as Spanner (opens in a new tab). The web tier is typically deployed on Compute Engine VMs in regional MIGs, where each MIG contains VMs in three different zones.
Internet traffic enters a global external Application Load Balancer which spreads load to web MIGs in two regions, then through a cross-region internal load balancer to app MIGs, which read and write to a synchronously replicated multi-region Spanner instance.
Rate limiting is the control that keeps a rapid or sustained increase in load from making the application or its dependencies fail. The increased load might be caused by malicious requests, such as network-based distributed denial-of-service (DDoS) attacks, or by non-malicious causes such as configuration errors in client software. If the application is not designed to handle the increased load, the application or the resources that it uses might fail and become unavailable.
Suitable rate-limiting mechanisms include quotas for the number of API requests that a Google Cloud service can receive. Rate limiting also helps optimize cost because project-level quotas for specific resources limit the billing that the project can incur for those resources. Load tests should therefore verify both that legitimate peak traffic succeeds and that excessive traffic is throttled before it exhausts backends or budget.
Network Service Tiers define which network carries traffic between systems on the internet and Google Cloud workloads, and the choice directly affects benchmarked latency. In Premium Tier, traffic from the internet enters the high-performance Google network at the point of presence (PoP) closest to the sending system. Within the Google network, traffic is routed from the entry PoP to the appropriate Google Cloud resource, such as a Compute Engine VM. Outbound traffic is sent through the Google network and exits at the PoP closest to the destination, which reduces the number of network hops and improves perceived availability.
For applications that serve users globally and have backends in more than one region, choose Premium Tier. Premium Tier leverages the global backbone and costs more than Standard Tier, while Standard Tier uses the public internet to route traffic. Because the tier changes the path and hop count, performance benchmarks and SLOs are only comparable when they are run against the tier that will be used in production.
Matching the load balancer to the workload means choosing the family and scope based on traffic type, client location, and backend placement. Application Load Balancers are proxy-based Layer 7 load balancers for HTTP and HTTPS traffic behind a single anycast IP address. Network Load Balancers are Layer 4 load balancers for TCP, UDP, or other IP protocol traffic, with proxy variants that terminate traffic and passthrough variants that preserve client source IP addresses.
The three families differ by layer, termination behavior, and protocol support:
| Load balancer family | OSI layer | Choose when |
|---|---|---|
| Application Load Balancers | Layer 7 | The workload is HTTP(S) and needs flexible Layer 7 features |
| Proxy Network Load Balancers | Layer 4 | The workload needs reverse-proxy TCP distribution, TLS offloading at scale, advanced traffic controls, or backends on-premises and in other clouds |
| Passthrough Network Load Balancers | Layer 4 | The workload must preserve client source IP, use direct server return, or handle UDP, ESP, GRE, ICMP, and ICMPv6 |
Narrow the choice further by deployment scope and requirements:
Exam tip: A global load balancer supports backends in multiple regions, while a regional load balancer supports backends in a single region but remains globally accessible.
Environment parity and test data management is the practice of making test environments behave like production while keeping test data realistic and protected. Parity ensures that unit, integration, and load test results are valid because configuration drift does not change behavior between environments. Test data management ensures that integration validation uses production-grade shapes and volumes without exposing sensitive information.
Infrastructure as Code (IaC) is the method for creating consistent, repeatable test environments that match production configuration. In Google Cloud, the physical network is virtualized through software-defined networking, so networks, test resources, and secure baselines are defined in code and deployed automatically with tools such as Terraform. Dedicated test environments and resources can be created on demand for integration and system tests and then torn down once tests are complete, which eliminates manual drift and makes test results trustworthy.
Parity also depends on automation in delivery. Cloud Build (opens in a new tab) executes builds and runs automated unit, integration, and end-to-end tests on each change, while Cloud Deploy promotes validated artifacts through a defined sequence of target environments. Because the same coded baseline flows from build to test to production, teams reduce uncertainty with each change and can make more changes before reliability falls below an acceptable level.
The choice of testing tools affects whether parity can be maintained:
When tools integrate with IaC and CI/CD, environments stay aligned and defects found in testing apply directly to production.
Test data management is the control of what data enters test pipelines so integration tests validate real business use cases without leaking sensitive data. Post-migration and integration tests run a data pipeline with full production-grade data as input and then inspect the output for validity. Data is confirmed complete when it meets predefined criteria where source and target are equal or similar enough, for example time-series data is complete when the most up-to-date record is no more than five minutes behind the current timestamp.
Protection is built into the same workflow through classification and inspection. Sensitive Data Protection (opens in a new tab) identifies, classifies, and protects sensitive data, including financial information, to support privacy requirements such as GDPR and CCPA. Combined with tested backups, retention controls, and restricted access to storage and databases, this allows teams to keep realistic data shapes for validation while sensitive values remain discovered, governed, and isolated from broader test access.
Exam tip: Comparing the same pipeline in source and target environments works only when the pipeline is deterministic and the input to both environments is identical.
Validation of the data and compute layers confirms that both moved data and processing engines produce correct results in the target environment. Teams implement checks in BigQuery (opens in a new tab) or as a batch job such as Dataflow (Apache Beam), run aggregation jobs in both source and target, and compare the calculated results. When source and target tables are stored in BigQuery in different regions, tables cannot be joined directly, so a client that can connect to both environments must pull and compare the results.
Validation of the compute layer confirms that every processing engine and method produces correct results in the target environment. Testing is less critical for managed engines like BigQuery or Dataflow, where Google manages the runtime, and more critical for non-managed engines where the team manages workload types.
| Engine type | Examples | Testing need |
|---|---|---|
| Managed computational engines | BigQuery, Dataflow | Lower priority; validate aggregation results for completeness and accuracy |
| Non-managed computational engines | Managed Service for Apache Spark running Apache Spark, Apache Hive, Apache Flink, or Apache MapReduce | Higher priority; test each runtime so different workload types are ready to transfer |
This split means a migration or environment change is verified both by data comparison across regions and by runtime coverage within the compute platform, so integration tests reflect how production will actually process data.
Automated unit and integration testing within CI/CD pipelines is the practice of validating every code change before it is deployed. Unit tests check individual code logic, integration tests check how components work together, and end-to-end tests check complete workflows. In Google Cloud, Cloud Build (opens in a new tab) runs these tests as part of the build, and Cloud Deploy promotes only validated artifacts through target environments in a defined sequence.
Automating tests in CI/CD pipelines validates changes before deployment to reduce errors and regressions. The pipeline runs tests automatically when new code arrives, so broken logic or broken connections between components are caught before they reach production. This approach builds a more stable and robust software system because each promotion depends on passing test results. Teams typically combine unit testing for code logic, integration testing for component interoperability, and end-to-end testing for full user flows in the same pipeline.
The Cloud Build and Cloud Deploy workflow moves code from source to tested artifact to staged release. Cloud Build is the service that executes builds on Google Cloud, and Cloud Deploy (opens in a new tab) is the managed service that automates delivery to a series of target environments in a defined promotion sequence. Source code flows from the repository into Cloud Build, test results gate the build, and the resulting artifact flows from Cloud Build to artifact storage and then to Cloud Deploy targets.
Google Cloud emulators simulate the behavior of Google Cloud services on a local machine for development and testing. The application connects to the local emulator instead of the production service, so tests run in an isolated environment without incurring service costs or impacting production. Emulators support faster iteration during development and provide a high-fidelity environment for debugging issues and verifying application behavior before deployment.
Exam tip: Run integration tests that need Pub/Sub, Firestore, Bigtable, Datastore, or Spanner against local emulators to avoid service costs and production impact, and gate promotion in Cloud Build on those test results.
Selecting testing tools determines how well unit and integration tests fit the workload and pipeline. Workloads migrated to Google Cloud must be tested for functional and non-functional scenarios to measure impact on functionality, integration, security, performance, and availability. The choice depends on how the tool connects to both the technology stack and the CI/CD framework that runs the tests.
Premium Tier carries traffic on the high-performance Google network from the point of presence closest to the sender to the point of presence closest to the destination, which reduces network hops, while Standard Tier routes traffic over the public internet. Because the tier changes the path and hop count, performance benchmarks and Service Level Objectives (SLOs) are only comparable when they are run against the tier that will be used in production.
Application Load Balancers are proxy-based Layer 7 load balancers for HTTP and HTTPS traffic behind a single anycast IP address when flexible Layer 7 features are needed. Proxy Network Load Balancers are Layer 4 load balancers for reverse-proxy TCP distribution, TLS offloading at scale, advanced traffic controls, or backends on-premises and in other clouds. Passthrough Network Load Balancers are Layer 4 load balancers that preserve client source IP addresses, use direct server return, or handle UDP, ESP, GRE, ICMP, and ICMPv6 traffic.
Cloud Load Balancing health checks route application traffic only to backends that are responsive, while autohealing for managed instance groups deletes unavailable virtual machines and creates new ones. A load test must therefore measure successful responses and latency against Service Level Objectives while autoscaling, health-check failures, and autohealing occur together, because infrastructure can show all virtual machines as RUNNING while application software on some machines has crashed.
Cloud Build executes builds and runs automated unit, integration, and end-to-end tests on each change so broken logic or broken connections between components are caught before production. Cloud Deploy then promotes only validated artifacts through target environments in a defined promotion sequence, with artifacts such as Docker containers or Java archives managed in Artifact Registry.
A development team is designing an automated CI/CD pipeline in Cloud Build for an event-driven application that ingests messages from Cloud Pub/Sub and persists records to Cloud Firestore.
To ensure software quality before deployment, the team must execute automated integration tests on every commit to validate component interoperability and end-to-end service interactions. The testing workflow must run within an isolated build environment without provisioning live cloud resources or incurring Google Cloud service billing costs.
How should the team configure their Cloud Build workflow to meet these requirements?
Replace all Pub/Sub and Firestore client calls exclusively with in-memory unit test mocks in application code and skip container integration tests.
Execute Google Cloud emulators in Cloud Build steps and point the test framework to the emulators using host environment variables.
Deploy the application build to a staging Cloud Run service and trigger tests through live Eventarc triggers linked to test topics.
Provision a dedicated temporary Google Cloud project using Terraform in each build, create live Pub/Sub and Firestore instances, and destroy the project after test completion.
Last updated