Prepare and test your skills

Prepare and test your skills

Serverless computing on Google Cloud lets teams run code without provisioning or managing servers. Cloud Run (opens in a new tab) is a fully managed platform for containerized applications, and Cloud Run functions is a serverless execution environment for single-purpose, event-driven functions. Both services share automatic provisioning, provider-managed scaling, and pay-per-use pricing, which lowers operational overhead and helps modernize existing applications.
Removing infrastructure management means Google Cloud handles provisioning, scaling, load balancing, and runtime maintenance instead of the application team. Cloud Run automatically routes incoming requests to the correct backend containers and balances load across them. Each deployment creates a revision, and Cloud Run scales that revision to the number of container instances needed for current requests. When a revision receives no traffic, it scales to zero instances by default, although the minimum instances setting can keep an instance warm for faster response.
Serverless services on Google Cloud are inherently elastic and scale instantly without fine-tuning rules. This elastic group includes Cloud Run, Cloud Run functions, BigQuery, Spanner, Eventarc, Workflows, and Pub/Sub. That behavior differs from Compute Engine autoscaling, which requires manually tuned rules for managed instance groups. Managed Service for Apache Spark (opens in a new tab) follows the same NoOps model by abstracting cluster management and using serverless autotuning with no idle compute overhead.
For enterprise traffic, serverless network endpoint groups let Cloud Run use HTTP(S) load balancing, which can enable Cloud CDN caching or serve traffic from multiple regions. API Gateway can add middleware such as authentication and rate limiting in front of serverless backends. For workloads that need more control than serverless allows, Google Kubernetes Engine (GKE) Autopilot mode automates node creation, automatic upgrades, and repairs. Autopilot is managed Kubernetes rather than serverless, but it reduces node maintenance for containerized workloads that require Kubernetes control.
Exam tip: Serverless autoscaling is instant and can scale down to zero resources, while autoscaling in services such as Compute Engine requires fine-tuning rules.
Streamlining deployment means reducing the steps between writing code and running it in production. Cloud Run deployment completes in seconds and supports revisions with traffic splitting, so a new version can run alongside the old version. Containers on Cloud Run can use familiar frameworks such as Nginx, Express.js, and Django, connect to a SQL database on Cloud SQL, and render dynamic HTML pages. Cloud Run functions lets teams deploy small functions that run only when an event invokes them.
Deployment workflows can be automated with Cloud Build, which modernizes the build-test-deploy cycle. Cloud Build integrates with Container Registry's Vulnerability Scanner and Binary Authorization to block images built from unknown source code or insecure repositories. Managed runtimes also reduce update work because Google maintains the underlying runtime. For Managed Service for Apache Spark serverless deployment, users pin to a minor runtime version while the service manages subminor versions, and GKE Autopilot applies automatic node upgrades and repairs.
Reducing maintenance with integrated observability means logs and metrics are collected automatically without agent setup. Cloud Run sends two types of logs to Cloud Logging: request logs, which are created automatically for requests, and container logs, which are emitted from container instances by application code. Teams can view these logs on the Cloud Run page in the Google Cloud console or in Cloud Logging Logs Explorer, which offers more detail and filtering.
Cloud Monitoring provides performance metrics, uptime checks, and alerts that notify when a metric threshold is exceeded. Cloud Run is integrated with Cloud Monitoring with no setup required, so metrics are captured automatically while services run at no charge on the fully managed version. Google Cloud Observability also includes Cloud Trace for application performance management. Together these tools let teams confirm health and troubleshoot without maintaining separate monitoring infrastructure.
Aligning cost with demand means paying for compute only while code runs and releasing capacity when idle. Cloud Run charges only for the time code runs, and Managed Service for Apache Spark serverless is billed only for Spark job execution time, excluding startup and teardown, based on resources consumed. Because compute is allocated only when a job or request is running, there is no idle compute overhead during quiet periods.
This model fits workloads with sporadic or unpredictable demand because capacity tracks actual use instead of pre-provisioned size. Cloud Run scales to zero container instances by default when a revision receives no traffic, which removes the need to maintain redundant capacity for low-load periods. The minimum instances setting trades some of that saving for performance by keeping an instance warm when a cold start delay is not acceptable.
Choosing serverless for modernization means selecting managed services to reduce operational work and focus on business logic. Cloud Run fits containerized websites, microservices, and event-driven services, while Cloud Run functions fits single-purpose functions that respond to events. Managed Service for Apache Spark serverless deployment is recommended for ad-hoc and interactive analysis, Spark-based applications and pipelines, workloads with sporadic or unpredictable demand, developer productivity focus, and simplified operations.
Migration can also simplify architecture by replacing self-managed messaging with Google Cloud services. For example, a function that used Amazon SQS and Amazon SNS can move to Pub/Sub and Cloud Tasks. When an application needs long-running processes, such as a process that listens on a queue, or protocols other than HTTP(S), GKE remains the option that provides Kubernetes control with automation by default.
Serverless support for modern architectures is the ability to build applications without managing servers while gaining automatic scaling, lower cost, and faster change. Serverless services handle provisioning, load balancing, and scaling, so teams focus on code and business logic. This support fits modernization because a monolithic application can be broken into smaller, event-driven pieces that deploy and scale independently.
Elastic serverless building blocks are managed Google Cloud services that scale instantly and can scale to zero when idle. Unlike Compute Engine autoscaling, which requires fine-tuning rules for managed instance groups, serverless autoscaling is automatic and immediate. The core building blocks cover compute, events, orchestration, and data:
Serverless elasticity means each service revision scales out to handle current requests and scales in to zero when idle, so teams pay only for the time code runs. This model removes idle cost and operational work during low demand while still absorbing spikes without manual capacity planning.
Event-driven processing with messaging and workflows is a pattern where an event starts work and messages carry data between loosely connected services. Pub/Sub decouples producers from consumers, Eventarc delivers events to serverless targets, and Workflows orders multi-service steps, which supports asynchronous and resilient applications. A typical serverless event flow moves in a fixed order:
A left-to-right process flow showing event source to Pub/Sub or Eventarc routing to Cloud Run compute to Workflows orchestration and persistent storage.
This flow lets frontend applications, APIs, and Internet of Things ingestion react quickly without waiting for a server to be ready. Because messaging separates each step, one service can be updated, retried, or scaled without stopping the whole application.
Exam tip: Cloud Run revisions scale to zero by default when they receive no traffic; set minimum instances only when you need a warm instance kept idle to avoid cold starts.
Microservices and rapid experimentation on Cloud Run mean breaking a large application into small containerized services that deploy and scale independently. Cloud Run is a fully managed serverless platform for containers that automatically routes requests, balances load, and manages container-instance autoscaling. Teams can use familiar technologies such as Nginx, Express.js, and Django, connect to a SQL database on Cloud SQL, and render dynamic pages without provisioning servers.
Cloud Run containers are ephemeral, so any temporary file storage lives only during processing and comes from service memory. For data that must last, traffic flows from the container instance to persistent services such as Cloud Storage, Firestore, or Cloud SQL. Each deployment creates a revision that scales automatically to meet incoming requests. Advanced routing can use serverless network endpoint groups with HTTP(S) load balancing, Cloud CDN caching, multi-region serving, and middleware such as API Gateway and Apigee for managed APIs.
This separation supports rapid cycles because individual teams can develop, test, and deploy one microservice without affecting other frontend or backend components. Cloud Run also integrates with Pub/Sub, Cloud Scheduler, Cloud Tasks, and Cloud SQL, so the same platform can serve autoscaled web frontends and internal microservices triggered by events.
Serverless platforms on Google Cloud scale automatically to match traffic and can reduce capacity to zero when no requests arrive. Cloud Run (opens in a new tab) runs containerized applications, Cloud Run functions (formerly Cloud Functions) runs single-purpose event-driven functions, and App Engine runs applications across multiple runtimes and platforms. Google Cloud describes these services as inherently elastic, alongside BigQuery, Spanner, Eventarc, Workflows, and Pub/Sub. This automatic, granular scaling removes the need to size infrastructure in advance and lets applications absorb variable traffic without paying for idle capacity.
Automatic and granular scaling means capacity tracks actual request volume rather than a pre-provisioned ceiling. Cloud Run scales each service revision to the number of container instances needed to handle all incoming requests, and by default scales a revision to zero instances when it receives no traffic. Cloud Run functions runs single-purpose functions that respond to events, and App Engine runs applications with automatic scaling. Unlike Compute Engine autoscaling, which requires fine-tuning rules, serverless autoscaling is instant and can scale down to zero resources.
The three serverless platforms differ in scaling behavior and warm-up support:
A side-by-side comparison of App Engine standard, App Engine flexible, and Cloud Run on scale-to-zero and warm-up behavior, contrasting instant serverless autoscaling with Compute Engine autoscaling that needs tuning rules.
| Platform | Automatic scaling | Manual scaling | Scale to zero | Warm-up requests |
|---|---|---|---|---|
| App Engine standard environment | Yes | Yes | Yes | Configurable |
| App Engine flexible environment | Yes | Yes | No | No |
| Cloud Run | Yes | Yes | Yes | Automatic |
Google Cloud recommends Cloud Run over App Engine for new projects and for modernizing existing applications, describing Cloud Run as a fully managed, modern hosting platform with advanced capabilities such as GPUs at lower prices.
Scale-to-zero is the mechanism that removes idle resource cost by shutting down capacity when there is no traffic. When a Cloud Run revision receives no traffic, it scales to zero container instances, and Cloud Run charges only for the time code runs. App Engine standard environment also scales to zero, but App Engine flexible environment does not. This difference makes the standard environment and Cloud Run better fits for workloads that are idle much of the time.
When a team wants to avoid the delay of starting from zero, the minimum instances setting on Cloud Run keeps a specified instance idle or warm. Keeping a warm instance trades some idle cost for faster response and more consistent performance. This is the central cost tradeoff in serverless planning: scale-to-zero minimizes cost, while warm instances trade cost for consistent performance.
Change the inputs and watch how the outcome changes.

Toggle minimum instances and incoming traffic to see how Cloud Run balances idle cost against request latency.
Handling variable traffic means distributing requests across available capacity without manual configuration. Cloud Run automatically routes incoming requests to the appropriate backend containers and performs load balancing as scaling decisions change. Teams that need enterprise-grade HTTP(S) load balancing can attach serverless network endpoint groups, which also enable Cloud CDN caching and serving traffic from multiple regions, and can add middleware such as API Gateway.
Load balancing routes traffic only to available resources and prevents individual resources from being overloaded, while health checks ensure traffic reaches only responsive backends. For workloads on Compute Engine, predictive autoscaling forecasts future load from historical metrics such as CPU utilization, with forecasts recomputed every few minutes. Without predictive autoscaling, a Compute Engine autoscaler can only scale reactively based on observed real-time changes.
Scaling beyond serverless covers managed scaling for container and virtual machine workloads that need more control. Autopilot mode in Google Kubernetes Engine (GKE) provides automation and scalability by default: GKE automatically scales nodes and resources based on traffic, creates new nodes for applications, and configures automatic upgrades and repairs. GKE Cluster Autoscaler periodically checks whether any pods are waiting for a node with free resources, resizes the node pool if that would let the waiting pods be scheduled, and deletes nodes that are not needed for an extended period when their pods can be scheduled elsewhere.
Compute Engine managed instance groups autoscale stateless applications by adding or removing virtual machine instances, and only managed instance groups can use an autoscaler. These container and virtual machine options require more configuration than serverless platforms but give teams more control over the underlying infrastructure. Choose serverless when instant scaling to zero and minimal operations matter most, and choose GKE or Compute Engine autoscaling when control over nodes, operating systems, or networking is required.
Exam tip: Cloud Run and App Engine standard environment can scale to zero, but App Engine flexible environment cannot.
Observability for scaling and performance means using automatic logs and metrics to confirm that capacity keeps pace with traffic. Cloud Run is integrated with Cloud Monitoring with no setup required, so metrics are captured automatically while services run at no charge on the fully managed version. Cloud Monitoring also provides performance metrics, uptime checks, and alerts that notify when metric thresholds are exceeded.
Cloud Run sends two types of logs to Cloud Logging: request logs, which are created automatically for requests sent to services, and container logs, which are emitted from container instances by application code. Together these logs and metrics let teams verify scaling behavior, detect slowdowns, and confirm that performance objectives are being met without maintaining separate monitoring agents.
Cloud Run autoscaling is instant and can scale down to zero resources, while Compute Engine autoscaling requires manually tuned rules for managed instance groups. Cloud Run scales each service revision to the number of container instances needed for current requests and scales to zero instances by default when the revision receives no traffic.
Use the minimum instances setting on Cloud Run when a cold start delay is not acceptable and you need a warm instance kept idle for faster response. By default a revision scales to zero when it receives no traffic to remove idle cost, so keeping a warm instance trades some idle cost for faster response and more consistent performance.
Event-driven processing starts when an event source emits a change and Pub/Sub or Eventarc routes the message to the subscribed target. The message invokes a container on Cloud Run or a function on Cloud Run functions, which runs only for the duration of the work. Workflows then passes output to the next service, and persistent data flows from the compute step to Cloud Storage, Firestore, Cloud SQL, BigQuery or Spanner.
App Engine standard environment can scale to zero, but App Engine flexible environment cannot. This difference makes the standard environment and Cloud Run better fits for workloads that are idle much of the time because they remove idle resource cost when there is no traffic.
A retail company is modernizing an existing web application to accelerate feature releases. The development team wants to focus entirely on writing business logic rather than provisioning virtual machines, managing cluster hardware, or configuring manual scaling rules.
Which operational benefit does adopting a serverless compute platform like Cloud Run provide to the organization?
Last updated