SkarpSkarp

Chapter 9 of 27

Cost Estimation and Architecture Trade-offs with the Google Cloud Pricing Calculator

Architectures are more than diagrams; they carry real price tags—practice estimating full-stack solutions and comparing design options using Google’s official tool.

27 min readen

Cost Estimation Mindset for an Associate Cloud Engineer

Why Cost Estimation Matters

As an Associate Cloud Engineer, you must deploy solutions that are reliable, secure, and cost-effective. Every VM, container, function, and bucket in your design has a real price tag.

The Core Tool

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. We will use it as our main cost-planning workspace.

Full-Stack View

You will estimate compute (Compute Engine, GKE, Cloud Run, Cloud Functions), data (Cloud SQL, BigQuery, Firestore, Spanner, Bigtable), Cloud Storage, and network egress together.

Exam Alignment

These skills mainly support Planning and configuring and Deploying and implementing a cloud solution, but they also help you ensure successful operation by avoiding surprise bills.

Getting Oriented in the Google Cloud Pricing Calculator

Product-Centric Estimates

The calculator is product-centric: you add products like Compute Engine, GKE, Cloud Run, Cloud Functions, Cloud Storage, Cloud SQL, and BigQuery as separate line items.

Safe Experimentation

The calculator only changes estimates, not real resources. You can freely try different regions, machine types, and quantities without affecting your environment.

Items and Totals

Each configured product shows its own monthly cost. The calculator also provides a combined total so you can see the full architecture cost at a glance.

Core Workflow

Start a new estimate, add a product, configure key cost drivers, repeat for all components, then review and share your final multi-product estimate.

Building a Simple Multi-Product Estimate (Web + DB + Storage)

Scenario Overview

You estimate a small web app: containerized frontend/API, managed relational DB, and Cloud Storage for user images. Focus on which configuration knobs drive cost.

Cloud Run Line Item

Add Cloud Run: pick a region, set vCPU and memory per instance, estimate monthly requests and average duration, and note that vCPU-seconds, memory-seconds, and requests drive cost.

Cloud SQL Line Item

Add Cloud SQL: choose engine, region, instance size, storage size, and whether to enable high availability. Observe the cost jump when you add HA for higher reliability.

Cloud Storage Line Item

Add Cloud Storage: choose Standard class for frequently accessed images, estimate GB stored and monthly egress. Egress to the internet is often a major cost driver.

Compute Trade-offs: Compute Engine vs GKE vs Cloud Run vs Cloud Functions

Four Compute Choices

You must compare Compute Engine, Google Kubernetes Engine, Cloud Run, and Cloud Functions. Each has different cost models and is suited to different workload patterns.

VM and Cluster Models

Compute Engine and GKE charge mainly per vCPU/RAM and hours per month. You pay even when utilization is low, so they favor steady, predictable workloads.

Serverless Models

Cloud Run and Cloud Functions charge per invocation and resource-seconds. They scale to zero and are cost-efficient for bursty or low-traffic workloads.

Exam Clues

Look for cues like 24/7 steady load (VMs or GKE) vs sporadic events or rare requests (Cloud Run or Cloud Functions) when choosing the most cost-effective option.

Thought Exercise: Choosing the Cheapest Compute Option

Exercise Instructions

For each workload, pick the cheapest of Compute Engine, GKE, Cloud Run, or Cloud Functions for the same performance and reliability. Then picture its calculator inputs.

Workload 1: IoT API

Thousands of devices send data every minute, 24/7, steady traffic, low latency. Which compute option and which main calculator parameters would you use?

Workload 2: Nightly Batch

A big image-processing job runs 2 hours nightly, idle the rest of the day. Which compute option avoids paying for idle capacity, and how do you estimate cost?

Workload 3: Rare Webhooks

A webhook endpoint gets a few hundred unpredictable calls per day. Which option scales to zero and charges mainly per request in the calculator?

Storage and Network Trade-offs: Cloud Storage Classes and Egress

Storage Classes to Know

For this course, Cloud Storage classes are: Standard, Nearline, Coldline, Archive, Regional Persistent Disk. Each trades off storage price vs access cost and performance.

Hot vs Cold Data

Standard is for frequently accessed data. Nearline, Coldline, and Archive are cheaper to store but more expensive to read, with Archive suited for rare access.

Regional Persistent Disk

Regional Persistent Disk is block storage for VMs, billed per GB-month. It is separate from Cloud Storage buckets but shows up as storage cost in estimates.

Network Egress Costs

Ingress is usually free, but egress to the internet or other regions is billed per GB and affected by Network Service Tiers, which trade off performance vs cost.

Estimating Storage and Egress for a Media Delivery App

Media App Profile

You store 50 TB of videos (hot for 1 month, then rarely accessed) and 2 TB of frequently accessed thumbnails, with mostly regional but some global traffic.

All Standard Baseline

First, model everything as Standard: 52 TB plus estimated internet egress. This is simple but likely expensive for old videos rarely watched.

Tiered Storage Model

Next, split: keep thumbnails and newest videos on Standard, move older videos to Nearline or Coldline. Model separate line items in the calculator.

Comparing Totals

Compare the two estimates. Coldline lowers storage cost a lot; access to old videos costs more per GB but is rare, so total monthly cost usually drops.

Quiz: Compute and Storage Cost Drivers

Check your understanding of key cost drivers before we move to full-stack trade-offs.

You are estimating costs for an API that receives a few hundred requests per day with unpredictable spikes. You want to minimize idle cost while keeping latency low. Which combination best matches a cost-efficient choice and the main parameters you would adjust in the pricing calculator?

  1. Compute Engine; number of VMs and hours per month
  2. Google Kubernetes Engine; number of nodes and cluster management fee
  3. Cloud Run; requests per month, average request duration, vCPU and memory
  4. Cloud Functions; number of VMs, attached persistent disk size
Show Answer

Answer: C) Cloud Run; requests per month, average request duration, vCPU and memory

For low, spiky traffic, Cloud Run is typically more cost-efficient than always-on VMs or clusters. In the pricing calculator, you mainly configure requests per month, average request duration, and the vCPU/memory configuration. Compute Engine and GKE charge per VM/node-hour, which wastes money during idle periods. Cloud Functions is also serverless, but its calculator inputs focus on invocations and execution time, not VM counts or persistent disks.

Quiz: Storage Class and Egress Choice

Reinforce your understanding of Cloud Storage classes and egress trade-offs.

A team stores compliance logs that must be kept for 7 years and are almost never read. Which choice is usually most cost-effective, and what should you pay closest attention to in the pricing calculator?

  1. Standard storage; focus on per-GB storage price only
  2. Archive storage; focus on both per-GB storage price and retrieval/egress costs
  3. Nearline storage; focus only on retrieval costs because storage is free
  4. Regional Persistent Disk; focus on disk IOPS and VM uptime
Show Answer

Answer: B) Archive storage; focus on both per-GB storage price and retrieval/egress costs

For long-term, rarely accessed data, Archive is usually the most cost-effective storage class. In the pricing calculator you should consider both the very low per-GB storage price and the higher retrieval and egress costs, to ensure that the rare reads will not unexpectedly dominate the bill. Nearline is for data accessed about once a month, and Regional Persistent Disk is for VM-attached block storage, not long-term log archives.

End-to-End Trade-offs: Adjusting Architecture to Reduce Cost

Right-Sizing Compute

Reduce VM sizes or serverless memory/CPU if utilization is low and performance targets are still met. This is often the simplest cost win in estimates.

Switching Compute Models

Compare always-on VMs or GKE with Cloud Run or Cloud Functions for low-utilization workloads. In the calculator, model the same traffic with both approaches.

Storage and Egress Tweaks

Move cold data to cheaper classes and estimate egress carefully. Use lifecycle ideas to split data across Standard, Nearline, Coldline, or Archive in your estimate.

Availability vs Cost

Toggle HA: regional databases, multi-zone clusters, or dual-region storage. Quantify the extra cost and decide if it is justified by uptime requirements.

Key Concepts Review

Use these flashcards to reinforce the most important definitions and lists from this module.

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.
Four compute choices for a given workload
Compute Engine, Google Kubernetes Engine, Cloud Run, Cloud Functions.
Data storage product choices (5 items)
Cloud SQL, BigQuery, Firestore, Spanner, Bigtable.
Cloud Storage classes in this course (5 items)
Standard, Nearline, Coldline, Archive, Regional Persistent Disk.
Network Service Tiers definition
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 are serverless compute options usually cheaper?
When workloads are bursty, low-volume, or have long idle periods, because you pay per request and resource-seconds instead of per VM-hour.
Main cost drivers for Cloud Run in the calculator
Number of requests, average request duration, and configured vCPU and memory per instance.
Main cost drivers for Compute Engine in the calculator
Machine type (vCPU/RAM), number of instances, hours per month, and attached disk size and type.

Key Terms

BigQuery
A fully managed, serverless data warehouse on Google Cloud, typically billed based on data storage and query processing.
Cloud Run
A fully managed compute platform that automatically scales stateless containers, with pricing based on vCPU-seconds, memory-seconds, and requests.
Cloud SQL
A fully managed relational database service for MySQL, PostgreSQL, and SQL Server, with pricing based on instance size, storage, and optional high availability.
Cloud Storage
Google Cloud’s unified object storage service that offers multiple storage classes for different access patterns and cost profiles.
Compute Engine
Google Cloud’s Infrastructure-as-a-Service offering that provides virtual machines with configurable vCPU, memory, and disks, billed primarily per instance-hour and GB of storage.
Archive storage
The lowest-cost Cloud Storage class for long-term archival data that is rarely accessed, with the highest access and early deletion costs.
Cloud Functions
A serverless, event-driven compute service where you deploy individual functions and pay per invocation, execution time, and allocated memory.
Coldline storage
A Cloud Storage class for data accessed a few times per year, with even lower storage price and higher access costs.
Nearline storage
A Cloud Storage class for data accessed about once a month, with lower storage price and higher access costs than Standard.
Standard storage
A Cloud Storage class optimized for frequently accessed (hot) data, with higher storage price but lower access costs.
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.
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.
Regional Persistent Disk
Block storage for Compute Engine VMs, replicated within a region, billed per GB-month and separate from Cloud Storage buckets.
Google Kubernetes Engine (GKE)
A managed Kubernetes service on Google Cloud where you pay mainly for the underlying Compute Engine nodes and any associated resources.
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.

Finished reading?

Test your understanding with a custom practice exam on this chapter.

Test yourself