GCP Developer Cheatsheet
GCP Developer Cheatsheet
Exam Overview
The Google Cloud Professional Cloud Developer exam assesses your ability to design,
build, and deploy applications on Google Cloud Platform. It covers topics such as
application development, deployment, debugging, monitoring, and security.
The Google Cloud Professional Cloud Developer exam assesses your ability to design,
build, and deploy scalable, secure, and highly available applications using Google-
recommended tools and best practices. It covers a wide range of topics, including
cloud-native applications, Google Cloud APIs, developer and AI tools, managed
services, orchestration tools, serverless platforms, containerized applications, test and
deployment strategies, problem determination and resolution, and datastores.
Candidates are expected to be proficient in at least one general-purpose programming
language and capable of instrumenting their code for metrics, logs, and traces.
Exam Sections:
This section covers the practical aspects of developing and testing applications on
Google Cloud.
This section deals with integrating different Google Cloud services within an
application.
Integrating with Google Cloud APIs: This involves using client libraries and
REST APIs, handling API authentication and authorization, and managing API
quotas and rate limits.
Integrating with data storage solutions: This covers connecting to Cloud SQL,
Cloud Spanner, Cloud Firestore, Cloud Bigtable, Cloud Storage, and performing
data migrations.
Integrating with messaging and eventing solutions: This includes using Cloud
Pub/Sub for asynchronous communication and using Eventarc for event-driven
architectures.
Monitoring and logging applications: This involves using Cloud Monitoring for
metrics and dashboards, using Cloud Logging for centralized logging, and setting
up alerts and notifications.
Compute Engine
Key Aspects: * Virtual Machines (VMs): Offers a wide range of predefined and custom
machine types, including general-purpose, compute-optimized, memory-optimized,
and accelerator-optimized instances. * Operating Systems: Supports various Linux
and Windows operating systems, with options for premium images and custom image
imports. * Storage: Provides local SSDs for high-performance temporary storage and
durable options like Hyperdisk and Persistent Disk for persistent block storage. *
Networking: Integrates with Cloud VPC for network configuration, including firewall
rules, IP addresses, and network interfaces. * Management: VMs can be managed via
the Google Cloud console, Google Cloud CLI, or REST-based API. * Use Cases: Custom
application hosting, high-performance computing (HPC), batch processing, and lift-
and-shift migrations of on-premises applications.
App Engine
App Engine is a fully managed Platform as a Service (PaaS) for developing and hosting
web applications and mobile backends. It abstracts away infrastructure management,
allowing developers to focus solely on writing code. App Engine supports multiple
programming languages and automatically scales applications to handle varying
traffic loads.
Key Aspects: * Event-Driven: Functions are triggered by events from Google Cloud
services (e.g., Cloud Storage uploads, Pub/Sub messages), Firebase, or HTTP requests.
* Serverless: Fully managed, pay-per-use model where you only pay for the compute
time your function executes. * Scalable: Automatically scales to handle incoming
events. * Versions: Cloud Functions (1st gen) and Cloud Functions (2nd gen), with the
latter built on Cloud Run for enhanced capabilities like longer request times and
higher concurrency. * Use Cases: Real-time data processing, chatbots, IoT backends,
webhooks, and lightweight APIs.
Google Kubernetes Engine (GKE) is a managed service for deploying, managing, and
scaling containerized applications using Kubernetes. It provides a robust environment
for running microservices and complex applications, abstracting away much of the
complexity of Kubernetes cluster management.
Key Aspects: * Managed Kubernetes: Google manages the Kubernetes control plane,
including upgrades, patching, and scaling. * Container Orchestration: Automates the
deployment, scaling, and management of containerized applications. * Modes of
Operation: Offers Autopilot mode (fully managed, workload-focused, cost-optimized)
and Standard mode (more control over node management). * Integration: Seamlessly
integrates with other Google Cloud services for CI/CD, monitoring, logging, and
security. * Use Cases: Microservices architectures, containerized applications, batch
processing, and machine learning workloads.
Cloud Storage
Cloud Storage is a highly scalable and durable object storage service for unstructured
data. It's designed for storing and accessing any type of data, from images and videos
to backups and archives.
Key Aspects: * Object Storage: Data is stored as objects within buckets. Objects are
immutable, meaning they cannot be changed after creation. * Scalability: Offers
virtually limitless storage capacity. * Durability: Designed for 99.999999999% (11
nines) annual durability. * Storage Classes: Provides various storage classes
(Standard, Nearline, Coldline, Archive) to optimize for cost and access frequency. *
Security: Integrates with Cloud IAM for access control, supports data encryption at
rest and in transit, and offers features like Bucket Lock and Object Versioning. * Use
Cases: Content distribution, data archiving, disaster recovery, big data analytics, and
serving static website content.
Cloud SQL
Cloud SQL is a fully managed relational database service for MySQL, PostgreSQL, and
SQL Server. It automates database administration tasks such as patching, backups,
replication, and high availability, allowing developers to focus on application
development.
Cloud Datastore is a highly scalable NoSQL document database built for automatic
scaling, high performance, and ease of application development. It's ideal for
applications requiring structured data that can scale to large volumes.
Key Aspects: * NoSQL Document Database: Stores data in documents organized into
collections. * Automatic Scaling: Scales automatically to handle large datasets and
high traffic. * ACID Transactions: Supports atomic, consistent, isolated, and durable
transactions. * Flexible Data Model: Schemaless design allows for flexible data
structures. * Strong Consistency: All queries are strongly consistent. * Use Cases:
User profiles, product catalogs, game states, and other applications requiring a
flexible, scalable NoSQL database.
Cloud Bigtable
Key Aspects: * NoSQL Wide-Column Database: Stores data in tables with billions of
rows and thousands of columns. * Massive Scalability: Scales linearly with the
number of nodes in the cluster. * High Throughput, Low Latency: Ideal for time-
series data, financial data, and IoT data. * Integration: Integrates with the Apache
ecosystem (HBase API compatible) and Google Cloud services like Dataflow and
Dataproc. * Use Cases: Ad personalization, financial data analysis, IoT data processing,
and operational analytics.
Cloud Spanner
Cloud Pub/Sub
Cloud Tasks
Cloud Tasks is a fully managed service that allows you to manage the execution,
dispatch, and delivery of a large number of distributed tasks. It's used for
asynchronous work outside of a user request, providing guaranteed delivery and
configurable retries.
Cloud Endpoints
Cloud Endpoints is a distributed API management system that helps you develop,
deploy, and manage APIs on Google Cloud. It provides tools for hosting, logging,
monitoring, and securing your APIs.
Key Aspects: * API Management: Provides a platform for managing the API lifecycle. *
Integration: Works with various Google Cloud backends (App Engine, Compute
Engine, GKE, Cloud Functions, Cloud Run). * Security: Offers features for
authentication, authorization, and API key management. * Observability: Integrates
with Cloud Logging and Cloud Monitoring for API observability. * API Definition:
Supports OpenAPI Specification and gRPC for API definition. * Use Cases: Exposing
backend services as APIs, managing access to internal and external APIs, and
implementing API security and rate limiting.
Apigee
Apigee is Google Cloud's native API management platform for building, managing, and
securing APIs at enterprise scale. It provides a comprehensive set of features for API
proxying, security, traffic management, analytics, and developer engagement.
Key Aspects: * API Proxy Layer: Sits between backend services and clients, offering
granular control over API traffic. * Policy-Driven: Uses policies for security, rate
limiting, transformation, and mediation. * Hybrid/Multicloud: Supports deploying
APIs across various environments, including on-premises and other clouds. *
Developer Portals: Facilitates developer onboarding and API consumption through
customizable portals. * Advanced Analytics: Provides detailed insights into API usage,
performance, and errors. * Use Cases: Exposing legacy systems as APIs, building new
digital products, monetizing APIs, and securing API ecosystems.
Cloud Monitoring
Cloud Monitoring provides visibility into the performance, uptime, and overall health
of your cloud-powered applications and infrastructure. It collects metrics, events, and
metadata from Google Cloud services and other sources.
Key Aspects: * Metrics Collection: Automatically collects metrics from Google Cloud
services, with options for custom metrics and integration with Prometheus. *
Dashboards: Provides pre-built and custom dashboards for data visualization. *
Alerting: Configurable alerting policies with various notification channels. * SLO
Monitoring: Supports defining and monitoring Service-Level Objectives. * Uptime
Monitoring: Monitors the availability of URLs, VMs, and APIs. * Use Cases:
Performance monitoring, capacity planning, incident detection, and root cause
analysis.
Cloud Logging
Cloud Logging is a real-time log management system for collecting, storing, analyzing,
and monitoring log data from Google Cloud resources, applications, and other
sources.
Key Aspects: * Centralized Log Management: Aggregates logs from various sources
into a single platform. * Log Exploration: Provides Logs Explorer for viewing and
filtering log entries, and Log Analytics for SQL-based querying. * Log Routing: Allows
routing logs to different destinations for storage or further analysis. * Log-based
Metrics: Create custom metrics based on log patterns for monitoring and alerting. *
Use Cases: Troubleshooting, security auditing, compliance, and operational insights.
Cloud Trace
Cloud Trace is a distributed tracing system that collects latency data from applications
and displays it in near real-time. It helps developers understand how requests
propagate through their distributed systems and identify performance bottlenecks.
Key Aspects: * Distributed Tracing: Visualizes the end-to-end flow of requests across
microservices. * Latency Analysis: Identifies performance bottlenecks and slow
operations. * Integration: Automatically collects trace data from App Engine and can
be integrated with other services and custom applications. * Use Cases: Performance
optimization, debugging distributed applications, and understanding service
dependencies.
Cloud IAM is Google Cloud's system for managing fine-grained authorization, allowing
you to control who can do what on which resources within your Google Cloud
environment. It's fundamental for implementing the principle of least privilege.
Key Aspects: * Principals: Users, service accounts, Google Groups, and domains that
can be granted access. * Roles: Collections of permissions that define what actions a
principal can perform. Includes predefined roles, custom roles, and basic roles. *
Resources: Google Cloud entities (projects, folders, organizations, VMs, buckets, etc.)
on which roles are granted. * Policy Inheritance: Policies set at higher levels (e.g.,
organization) are inherited by lower-level resources (e.g., projects, VMs). * Use Cases:
Managing access to Google Cloud resources, enforcing security policies, and auditing
access.
Cloud VPC provides networking functionality for your Google Cloud resources,
enabling you to define and control your network topology, IP addressing, and routing.
It's a global resource that allows you to connect resources across regions.
Key Aspects: * Global Network: A single VPC network can span multiple regions, with
regional subnetworks. * Firewall Rules: Distributed virtual firewalls for granular
control over ingress and egress traffic. * Shared VPC: Allows multiple projects to use a
common VPC network, centralizing network administration. * VPC Network Peering:
Connects VPC networks privately across different projects or organizations. * Private
Google Access: Enables VMs without external IP addresses to access Google APIs and
services privately. * Use Cases: Building isolated network environments, connecting
hybrid cloud deployments, and securing network communications.
Key Aspects: * Global Anycast IP: Provides a single global IP address for all backends,
enabling cross-region load balancing. * Software-Defined: No physical hardware to
manage, offering high scalability and reliability. * Layer 4 and Layer 7: Supports both
network (TCP/UDP) and application (HTTP/HTTPS) layer load balancing. * External
and Internal: Distributes traffic from the internet or within Google Cloud. *
Integration: Integrates with Cloud CDN for content caching and Google Cloud Armor
for DDoS protection. * Use Cases: Distributing traffic to web servers, microservices,
and other application backends for high availability and performance.
Cloud CDN (Content Delivery Network)
Cloud CDN uses Google's global edge network to serve content closer to users,
accelerating websites and applications. It caches content at Google's points of
presence (PoPs) around the world, reducing latency and offloading traffic from origin
servers.
Key Aspects: * Global Edge Network: Leverages Google's extensive network of edge
locations. * Caching: Caches static and dynamic content at the edge for faster delivery.
* Integration: Works seamlessly with Google Cloud Load Balancing. * Cache
Invalidation: Allows for invalidating cached content when updates are needed. * Use
Cases: Accelerating website and application delivery, reducing origin server load, and
improving user experience.
Continuous Integration (CI) and Continuous Delivery (CD) are crucial for modern
software development. This section outlines best practices for implementing CI/CD
pipelines on Google Cloud, particularly with Google Kubernetes Engine (GKE).
CI involves frequently integrating code changes into a main branch to detect issues
early. CI pipelines are typically triggered by code pushes and include steps like linting,
testing, and building, producing an artifact for deployment.
Create Pipelines for Rapid Iteration: Aim for short CI pipeline run times (under
10 minutes) to facilitate fast feedback. Consider having both Rapid Pipelines (for
quick feedback on feature branches) and Full Pipelines (for comprehensive tests
on merge/pull requests and main branch commits).
Test Your Container Images: Run all necessary tests (unit, functional,
integration, load/performance) on your code and build artifacts. Crucially, test
the structure of your built container images to ensure correct execution and
content. Tools like Container Structure Tests can be used for this.
Establish Security Early in Pipelines: Implement security checks as early as
possible in the development lifecycle to reduce costs and risks. This includes
requiring subject matter expert review, implementing linting and static code
analysis, scanning container images for vulnerabilities (e.g., using Container
Analysis), and preventing vulnerable images from being deployed using Binary
Authorization.
Promote, Rather Than Rebuild Container Images: Build container images once
and promote them across environments (development, staging, production)
instead of rebuilding them at each stage. This prevents minor differences and
ensures the tested image is the deployed image.
Consider Using More Advanced Deployment and Testing Patterns: GKE offers
flexibility for deployment patterns based on business goals. Examples include:
Recreating a deployment: Fully scales down the old version before scaling
up the new version.
Serverless Architecture
Serverless architecture is a software design approach where developers can build and
run applications without managing the underlying server infrastructure. The cloud
provider dynamically manages the allocation and provisioning of servers.
Microservices Architecture
Google Cloud Products for Microservices: * Google Kubernetes Engine (GKE): Ideal
for orchestrating containerized microservices. * Cloud Run: For deploying stateless
microservices as containers. * Cloud Pub/Sub: For asynchronous communication
between microservices. * Cloud Endpoints/Apigee: For API management and
securing microservices. * Various Databases: Cloud SQL, Cloud Spanner, Cloud
Firestore, Cloud Bigtable for data storage.
Principle of Least Privilege: Grant only the necessary permissions to users and
service accounts. Avoid overly permissive roles (e.g., Owner , Editor ) in
production.
VPC Networks and Firewall Rules: Design segmented VPC networks and
implement strict firewall rules to control traffic. Use VPC Service Controls to
create security perimeters and mitigate data exfiltration.
Load Balancing and CDN: Utilize Cloud Load Balancing for secure traffic
distribution and integrate with Google Cloud Armor for DDoS protection and WAF
capabilities. Use Cloud CDN to reduce the attack surface on origin servers.
Encryption Everywhere:
Encryption at Rest: Google Cloud encrypts data at rest by default. Consider
Customer-Managed Encryption Keys (CMEK) or Customer-Supplied
Encryption Keys (CSEK) for sensitive data.
Data Loss Prevention (DLP): Implement DLP policies to identify, classify, and
protect sensitive data.
Secure Coding Practices: Follow secure coding guidelines, and regularly scan
code for vulnerabilities using SAST and DAST tools.
Container Security: Use trusted base images, scan container images for
vulnerabilities (e.g., with Container Analysis), implement Binary Authorization to
ensure only trusted images are deployed, and run containers with least
privileges.
Serverless Security: For Cloud Functions and Cloud Run, ensure minimal
necessary permissions and authorized triggers.
CI/CD Pipeline Security: Integrate security checks early into pipelines, ensure
integrity of build artifacts, and use secure build environments.
Audit Logs: Regularly review Cloud Audit Logs to track administrative activities
and data access.
Security Command Center: Use for a centralized view of your security posture,
identifying vulnerabilities and threats.
Incident Response Plan: Develop and regularly test a plan for handling security
breaches.
By adhering to these best practices, developers can significantly enhance the security
posture of their applications deployed on Google Cloud Platform.
Effective API design and robust API management are critical for building scalable and
maintainable applications on Google Cloud. This section covers best practices for
designing APIs and leveraging Google Cloud's API management solutions.
API Design Best Practices
Custom Methods: Use sparingly for operations that don't fit standard methods.
Error Handling: Implement standardized error models and codes for clear,
actionable error messages.
API management encompasses the entire lifecycle of APIs, from development and
deployment to monitoring and security. Google Cloud offers robust solutions for API
management, with Apigee being its flagship platform.
Apigee is Google Cloud's native API management platform, designed for enterprise-
grade API programs. It provides comprehensive features for building, managing, and
securing APIs at scale.
Key Features of Apigee: * API Proxy Layer: Acts as a facade for backend services,
providing granular control over security, rate limiting, quotas, and analytics. * Policy-
Driven: Offers a rich set of pre-built policies for security, traffic management, data
transformation, and custom logic. * Hybrid/Multicloud Deployment: Supports
deploying APIs across various environments, including on-premises and other cloud
providers. * Developer Portals: Facilitates developer onboarding and API
consumption through customizable portals. * Advanced Analytics: Provides detailed
insights into API usage, performance, and errors. * API Monetization: Enables creating
rate plans and business models for API products.
How Apigee Works: Apigee sits between API consumers and backend services,
allowing you to apply policies and manage API traffic without modifying backend
code.
Common Use Cases for Apigee: * Exposing legacy systems as APIs. * Building new
digital products and services. * Monetizing APIs. * Securing API ecosystems.
Choosing the right API management solution depends on the complexity, scale, and
specific requirements of your API ecosystem.
Principle of Least Privilege: Grant only the necessary permissions to users and
service accounts. Avoid overly permissive roles (e.g., Owner , Editor ) in
production.
VPC Networks and Firewall Rules: Design segmented VPC networks and
implement strict firewall rules to control traffic. Use VPC Service Controls to
create security perimeters and mitigate data exfiltration.
Load Balancing and CDN: Utilize Cloud Load Balancing for secure traffic
distribution and integrate with Google Cloud Armor for DDoS protection and WAF
capabilities. Use Cloud CDN to reduce the attack surface on origin servers.
Data Protection Best Practices
Encryption Everywhere:
Encryption at Rest: Google Cloud encrypts data at rest by default. Consider
Customer-Managed Encryption Keys (CMEK) or Customer-Supplied
Encryption Keys (CSEK) for sensitive data.
Data Loss Prevention (DLP): Implement DLP policies to identify, classify, and
protect sensitive data.
Secure Coding Practices: Follow secure coding guidelines, and regularly scan
code for vulnerabilities using SAST and DAST tools.
Container Security: Use trusted base images, scan container images for
vulnerabilities (e.g., with Container Analysis), implement Binary Authorization to
ensure only trusted images are deployed, and run containers with least
privileges.
Serverless Security: For Cloud Functions and Cloud Run, ensure minimal
necessary permissions and authorized triggers.
CI/CD Pipeline Security: Integrate security checks early into pipelines, ensure
integrity of build artifacts, and use secure build environments.
Audit Logs: Regularly review Cloud Audit Logs to track administrative activities
and data access.
Security Command Center: Use for a centralized view of your security posture,
identifying vulnerabilities and threats.
Incident Response Plan: Develop and regularly test a plan for handling security
breaches.
By adhering to these best practices, developers can significantly enhance the security
posture of their applications deployed on Google Cloud Platform.
Effective API design and robust API management are critical for building scalable and
maintainable applications on Google Cloud. This section covers best practices for
designing APIs and leveraging Google Cloud's API management solutions.
Custom Methods: Use sparingly for operations that don't fit standard methods.
Error Handling: Implement standardized error models and codes for clear,
actionable error messages.
API management encompasses the entire lifecycle of APIs, from development and
deployment to monitoring and security. Google Cloud offers robust solutions for API
management, with Apigee being its flagship platform.
Apigee is Google Cloud's native API management platform, designed for enterprise-
grade API programs. It provides comprehensive features for building, managing, and
securing APIs at scale.
Key Features of Apigee: * API Proxy Layer: Acts as a facade for backend services,
providing granular control over security, rate limiting, quotas, and analytics. * Policy-
Driven: Offers a rich set of pre-built policies for security, traffic management, data
transformation, and custom logic. * Hybrid/Multicloud Deployment: Supports
deploying APIs across various environments, including on-premises and other cloud
providers. * Developer Portals: Facilitates developer onboarding and API
consumption through customizable portals. * Advanced Analytics: Provides detailed
insights into API usage, performance, and errors. * API Monetization: Enables creating
rate plans and business models for API products.
How Apigee Works: Apigee sits between API consumers and backend services,
allowing you to apply policies and manage API traffic without modifying backend
code.
Common Use Cases for Apigee: * Exposing legacy systems as APIs. * Building new
digital products and services. * Monetizing APIs. * Securing API ecosystems.
API Gateway: A fully managed service for creating, securing, and monitoring APIs
for serverless backends (Cloud Functions, Cloud Run, App Engine).
Choosing the right API management solution depends on the complexity, scale, and
specific requirements of your API ecosystem.