Selecting compute choices for workloads

5 minutes 5 Questions

Selecting compute choices for workloads in Google Cloud requires understanding the various options available and matching them to your specific requirements. Google Cloud offers several compute services, each designed for different use cases. **Compute Engine** provides virtual machines (VMs) with full control over the operating system and configuration. This option suits workloads requiring custom environments, legacy applications, or specific software installations. You can choose from predefined machine types or create custom configurations based on CPU and memory needs. **Google Kubernetes Engine (GKE)** is ideal for containerized applications. It manages Kubernetes clusters and handles container orchestration, scaling, and deployment. GKE works best for microservices architectures and applications requiring high portability across environments. **Cloud Run** offers a serverless container platform where you deploy containerized applications that scale automatically based on traffic. You pay only for actual usage, making it cost-effective for variable workloads. Cloud Run is excellent for stateless HTTP-driven applications. **Cloud Functions** provides event-driven serverless computing for small, single-purpose functions. It responds to cloud events from services like Cloud Storage or Pub/Sub. This option suits lightweight processing tasks and automation workflows. **App Engine** is a fully managed platform for building and deploying applications. The Standard Environment supports specific runtimes with automatic scaling, while the Flexible Environment allows custom runtimes in containers. When selecting compute options, consider factors such as: - **Scalability requirements**: Serverless options auto-scale efficiently - **Cost structure**: Pay-per-use versus sustained-use discounts - **Management overhead**: Fully managed versus self-managed infrastructure - **Application architecture**: Monolithic versus microservices - **Startup time requirements**: VMs take longer than containers or functions - **State management**: Stateful applications may need persistent VMs Matching workload characteristics to the appropriate compute service ensures optimal performance, cost efficiency, and operational simplicity in your cloud solution.

Selecting Compute Choices for Workloads - GCP Associate Cloud Engineer Guide

Why is This Important?

Selecting the right compute option is fundamental to building cost-effective, scalable, and performant cloud solutions. The GCP Associate Cloud Engineer exam heavily tests your ability to match workload requirements with appropriate compute services. Making the wrong choice can lead to over-provisioning, unnecessary costs, or performance bottlenecks.

What Are the Compute Options in GCP?

Google Cloud Platform offers several compute services, each designed for specific use cases:

1. Compute Engine (VMs)
- Infrastructure as a Service (IaaS)
- Full control over operating system and configuration
- Best for: lift-and-shift migrations, custom applications, legacy workloads
- Machine types: general-purpose, compute-optimized, memory-optimized, GPU-enabled

2. Google Kubernetes Engine (GKE)
- Container orchestration platform
- Best for: containerized microservices, hybrid deployments, applications requiring portability
- Offers Autopilot mode for hands-off cluster management

3. Cloud Run
- Fully managed serverless container platform
- Best for: stateless containers, HTTP-driven applications, event-driven workloads
- Scales to zero when not in use

4. Cloud Functions
- Function as a Service (FaaS)
- Best for: event-driven processing, lightweight APIs, glue code between services
- Supports Node.js, Python, Go, Java, and more

5. App Engine
- Platform as a Service (PaaS)
- Standard Environment: sandboxed, fast scaling, limited language support
- Flexible Environment: Docker containers, more languages, custom runtimes
- Best for: web applications, mobile backends

How to Select the Right Compute Option

Consider these factors when making your decision:

Control vs. Management Overhead
- Need full OS control? → Compute Engine
- Want managed containers? → GKE or Cloud Run
- Prefer code-only focus? → Cloud Functions or App Engine

Workload Characteristics
- Stateful applications → Compute Engine or GKE with persistent volumes
- Stateless HTTP services → Cloud Run or App Engine
- Event-triggered tasks → Cloud Functions
- Batch processing → Compute Engine with preemptible VMs or GKE

Scaling Requirements
- Predictable scaling → Compute Engine with managed instance groups
- Rapid auto-scaling → Cloud Run, Cloud Functions, or App Engine
- Complex orchestration → GKE

Cost Considerations
- Pay only for execution time → Cloud Functions, Cloud Run
- Sustained use discounts → Compute Engine
- Committed use discounts → Compute Engine, GKE

Exam Tips: Answering Questions on Selecting Compute Choices

1. Look for keywords in the question:
- 'Containers' or 'Docker' → Think GKE or Cloud Run
- 'Serverless' or 'no infrastructure management' → Cloud Functions, Cloud Run, or App Engine
- 'Full control' or 'custom OS' → Compute Engine
- 'Event-driven' or 'trigger' → Cloud Functions
- 'Microservices' → GKE or Cloud Run

2. Eliminate based on constraints:
- If the question mentions needing to minimize operational overhead, eliminate Compute Engine first
- If portability between clouds is mentioned, consider GKE or Cloud Run
- If the workload is stateful, be cautious with serverless options

3. Cost optimization hints:
- Sporadic traffic patterns → serverless options (scale to zero)
- Steady-state workloads → Compute Engine with committed use discounts
- Fault-tolerant batch jobs → preemptible or spot VMs

4. Remember the hierarchy:
- Most managed: Cloud Functions → Cloud Run → App Engine → GKE Autopilot → GKE Standard → Compute Engine: Least managed

5. Common exam scenarios:
- Web application with variable traffic → App Engine or Cloud Run
- Legacy application migration → Compute Engine
- Microservices architecture → GKE
- Image processing on upload → Cloud Functions
- Stateless API with unpredictable traffic → Cloud Run

Quick Reference Decision Tree

Do you need full OS control? → Compute Engine
Is it containerized? → Do you need orchestration? → GKE | Just need to run containers? → Cloud Run
Is it a simple function triggered by events? → Cloud Functions
Is it a web application? → App Engine
Test mode:
More Selecting compute choices for workloads questions
29 questions (total)

Other Planning and Implementing a Cloud Solution concepts

AlloyDBAvailability policy for Compute EngineBigQueryBigtableChoosing and deploying data productsChoosing and deploying load balancersChoosing and deploying storage productsChoosing storage for Compute EngineCloud InterconnectCloud Next Generation Firewall (Cloud NGFW)Cloud RunCloud Run functionsCloud SQLCloud StorageCloud Storage classes (Standard, Nearline, Coldline, Archive)Cloud Storage object change notificationsCloud VPNCommand-line data uploadCompute EngineConfig ConnectorConfiguring OS LoginConfiguring VM ManagerCreating autoscaled managed instance groupsCreating a VPC with subnetsCustom machine typesCustom mode VPCDataflowDeploying containerized applications to GKEDeploying GKE clustersDeploying to serverless compute platformsEstablishing network connectivityEventarcFabric FASTFilestoreFirestoreFirewall ingress and egress rulesGKE AutopilotGoogle Cloud HyperdiskGoogle Cloud Managed Service for Apache KafkaGoogle Cloud NetApp VolumesGoogle Kubernetes Engine (GKE)Helm for KubernetesIaC versioning and state managementInfrastructure as code toolingInstalling kubectl CLIInstance templatesKnative servingLaunching a compute instanceLoading data into Google CloudMaintaining multi-region redundancyMemorystoreNetwork Service TiersPlanning and executing IaC deploymentsPrivate GKE clustersProcessing Pub/Sub eventsPub/SubRegional GKE clustersRegional Persistent DiskSecure TagsService accounts in firewall rulesShared VPCSpannerSpot VM instancesSSH keys for Compute EngineStorage Transfer ServiceTerraform on Google CloudUsing Tags in Cloud NGFW policy rulesVPC Network PeeringZonal Persistent Disk