Chapter 9 of 26
Cost Estimation and Optimization with the Google Cloud Pricing Calculator
Translate architecture ideas into concrete cost estimates and spot opportunities to optimize using official pricing tools and configuration options.
Orientation: Why Cost Estimation Matters for an ACE
Why This Matters
For the Associate Cloud Engineer exam, you must turn architecture ideas into concrete, defensible cost estimates using Google Cloud pricing concepts and tools.
The Core Tool
By May 2026, the Google Cloud pricing calculator remains the main browser-based tool to estimate costs by adding products and configuring options.
Exam Focus Areas
You are tested on which configuration fields affect cost, how services behave cost-wise, and how discounts and autoscaling influence the final bill.
Meet the Google Cloud Pricing Calculator
Canonical Definition
Memorize: The Google Cloud pricing calculator is a tool that lets you add and configure products to get a cost estimate to share with your team.
What You Do With It
You pick services like Compute Engine or BigQuery, set regions and usage, and the calculator shows an estimated monthly cost.
Exam-Angle
Expect questions where a calculator configuration is described and you must choose a change that lowers cost but still meets requirements.
Hands-On Walkthrough: Building a Simple Multi-Tier Estimate
Scenario Overview
We estimate a 3-tier app in us-central1: Compute Engine for web/app, Cloud Storage for static assets, and Cloud SQL for the database.
Compute Engine in the Calculator
Add Compute Engine, pick region, machine type, number of VMs, OS, hours per month, and boot disk size to see monthly compute and disk costs.
Cloud Storage and Cloud SQL
Add Cloud Storage with region, class, GB stored, and egress; then Cloud SQL with region, tier, storage, and HA. Together they form the multi-tier estimate.
Estimating Compute: Compute Engine vs Cloud Run vs GKE vs Cloud Functions
Compute Engine
VM cost is driven by vCPU, RAM, disk, GPUs, hours, and egress. You pay for provisioned time, even when utilization is low.
Cloud Run and Cloud Functions
Serverless options bill per request and resource-seconds. They can scale to zero and avoid most idle cost, ideal for spiky workloads.
GKE Cost Shape
GKE Standard charges for nodes; Autopilot charges per pod resources. Kubernetes adds baseline complexity and cost but can be efficient at scale.
Worked Example: Compute Engine vs Cloud Run Cost Shape
Scenario
An API has spiky traffic: sometimes idle, sometimes very busy. You compare Compute Engine VMs to Cloud Run using the calculator.
Compute Engine Shape
Two e2-standard-4 VMs running 24/7 have a fixed monthly cost, even if the API sits idle much of the time.
Cloud Run Shape & Exam Hint
Cloud Run bills per request and resource-seconds, scaling to zero. Phrases like "avoid paying for idle" usually point to serverless options.
Estimating Storage and Analytics: Cloud Storage, Cloud SQL, BigQuery
Cloud Storage Costs
Cloud Storage pricing depends on storage class, GB stored, retrieval, and egress. Lower-cost classes suit infrequently accessed data.
Cloud SQL Costs
Cloud SQL charges for vCPU/RAM (tier), storage, backups, HA, and hours. Enabling HA increases cost but improves availability.
BigQuery Costs
BigQuery charges for storage and query bytes processed. Partitioning and clustering tables can reduce scanned data and query cost.
Discounts and Cost-Efficient Design: Sustained Use, Committed Use, and Patterns
Sustained & Committed Use
Long-running VMs earn automatic sustained use discounts. Committed use discounts trade a 1–3 year resource commitment for lower prices.
Design Patterns
Right-size resources, use autoscaling/serverless, choose cheaper storage classes, and partition BigQuery tables to limit scanned data.
Network Service Tiers
Network Service Tiers lets you balance performance and cost by choosing Premium or Standard tiers for outbound traffic.
Thought Exercise: Tuning a Design for Cost
Work through this scenario mentally as if you were adjusting settings in the pricing calculator.
Scenario
You inherit a simple analytics pipeline:
- Raw logs are written to a Cloud Storage Standard bucket in `us-central1`.
- A daily batch job loads these logs into a single large BigQuery table.
- Analysts run ad‑hoc queries on the last 7 days of data only.
- The monthly bill is higher than expected.
Your task
Think through these questions and pick the best options mentally:
- Cloud Storage class
- A. Keep everything in Standard.
- B. Move logs older than 30 days to Nearline or Coldline.
- C. Move all logs immediately to Archive.
- BigQuery table design
- A. Keep a single unpartitioned table.
- B. Partition the table by ingestion date and have analysts filter on the last 7 days.
- C. Export data to CSV and query from Cloud Storage instead of BigQuery.
- Region and egress
- All processing and analysts are in `us-central1`. Which statement is most cost‑efficient?
- A. Move the bucket to `europe-west1` to diversify.
- B. Keep everything in `us-central1` to minimize egress.
- C. Split resources across multiple regions for "resilience".
Pause for a minute and decide your answers.
Suggested reasoning
- For (1), B is usually best: keep recent, frequently accessed logs in Standard; move older data to a colder class.
- For (2), B is best: partitioning by date lets BigQuery scan only 7 days instead of the full table.
- For (3), B is best: co‑locating all resources in `us-central1` minimizes cross‑region egress and cost.
This is exactly the type of design‑tuning reasoning the exam tests, even if it does not show the calculator UI.
Quick Check: Picking the Right Compute Option
Answer this exam-style question about compute and cost.
A startup has a small REST API that receives very low traffic at night but can experience sudden spikes during marketing campaigns. They want to minimize cost during idle periods and avoid managing servers. Which option is MOST cost-efficient while meeting their needs?
- Run a single small Compute Engine VM 24/7 and scale up manually during spikes.
- Deploy the API to Cloud Run with minimum instances set to 0 and allow it to scale based on incoming requests.
- Create a GKE Standard cluster with three nodes and deploy the API as a Deployment with Horizontal Pod Autoscaling.
- Use Cloud SQL to host the API logic and query it directly from clients.
Show Answer
Answer: B) Deploy the API to Cloud Run with minimum instances set to 0 and allow it to scale based on incoming requests.
Cloud Run with minimum instances set to 0 is designed for HTTP workloads with variable traffic, can scale to zero to avoid idle cost, and removes server management. A 24/7 VM still charges during idle time. GKE has baseline cluster costs and more operational overhead. Cloud SQL is a managed database, not a place to run API logic.
Quick Check: Storage and BigQuery Cost Optimization
Test your understanding of cost levers for storage and analytics.
You manage a BigQuery dataset with 5 years of event data, but most queries only analyze the last 30 days. Costs for queries are high. What change in the pricing calculator configuration BEST reflects a cost-optimized design?
- Increase the BigQuery storage size estimate to account for 5 years of data.
- Switch BigQuery to a different region with cheaper storage.
- Model the table as partitioned on event date and reduce the estimated query bytes per month to reflect scanning only 30 days.
- Reduce the Cloud SQL instance size because it stores less data.
Show Answer
Answer: C) Model the table as partitioned on event date and reduce the estimated query bytes per month to reflect scanning only 30 days.
Partitioning the BigQuery table on event date and querying only the last 30 days reduces the bytes scanned, which lowers query cost. In the calculator, you would lower the estimated query bytes per month to reflect this. Changing regions or Cloud SQL size does not directly address BigQuery query costs, and increasing storage size would increase cost.
Key Terms and Concepts Review
Use these flashcards to reinforce core definitions and cost concepts before moving on.
- Google Cloud pricing calculator
- The Google Cloud pricing calculator is a tool that lets you add and configure products to get a cost estimate to share with your team.
- Associate Cloud Engineer (role expectation)
- An Associate Cloud Engineer deploys and secures applications, services, and infrastructure, monitors operations of multiple projects, and maintains enterprise solutions to ensure that they meet target performance metrics.
- Network Service Tiers
- Network Service Tiers is a Google Cloud networking feature that lets you optimize network performance and cost by choosing between different network quality tiers for outbound traffic.
- When is Cloud Run typically more cost-efficient than Compute Engine?
- When traffic is highly variable or low most of the time, and you want to avoid paying for idle VMs. Cloud Run bills per request and resource-seconds and can scale to zero.
- Sustained Use Discount (SUD)
- An automatic discount applied to many long-running Compute Engine VMs when they run a large portion of the month, reducing the effective hourly price.
- Committed Use Discount (CUD)
- A discount you receive when you commit to using a certain amount of vCPU/RAM or specific services for 1 or 3 years, in exchange for lower prices than on-demand.
- Cloud Storage class choice for rarely accessed backups
- Use Nearline, Coldline, or Archive depending on how rarely data is accessed and how tolerant you are of higher retrieval cost and latency.
- BigQuery partitioning benefit
- Partitioning tables (for example, by date) lets queries scan only relevant partitions, reducing bytes processed and query cost.
- Right-sizing resources
- Choosing the smallest machine types or configurations that still meet performance and SLA requirements, instead of over-provisioning.
Key Terms
- BigQuery
- Google Cloud's fully managed, serverless data warehouse for large-scale analytics, billed primarily by storage and query bytes processed.
- Cloud Run
- A fully managed compute platform for running containerized HTTP workloads that scales automatically, including to zero, and charges per request and resource-seconds.
- Cloud SQL
- A fully managed relational database service for MySQL, PostgreSQL, and SQL Server on Google Cloud.
- Right-sizing
- The practice of choosing resource sizes (for example, VM machine types) that closely match actual performance needs, avoiding over-provisioning.
- Cloud Storage
- Google Cloud's unified object storage service for storing and serving unstructured data at various performance and cost tiers.
- Network Service Tiers
- Network Service Tiers is a Google Cloud networking feature that lets you optimize network performance and cost by choosing between different network quality tiers for outbound traffic.
- Committed Use Discount
- A discount you receive when you commit to using a certain amount of vCPU/RAM or specific services for 1 or 3 years, in exchange for lower prices than on-demand.
- Sustained Use Discount
- An automatic discount applied to many long-running Compute Engine VMs when they run a large portion of the month, reducing the effective hourly price.
- Associate Cloud Engineer
- An Associate Cloud Engineer deploys and secures applications, services, and infrastructure, monitors operations of multiple projects, and maintains enterprise solutions to ensure that they meet target performance metrics.
- Partitioned table (BigQuery)
- A BigQuery table that is divided into segments, often by date, so that queries can scan only relevant partitions and reduce processed bytes.
- Google Kubernetes Engine (GKE)
- A managed Kubernetes service on Google Cloud where you run containerized applications on clusters of Compute Engine instances.
- Google Cloud pricing calculator
- The Google Cloud pricing calculator is a tool that lets you add and configure products to get a cost estimate to share with your team.