GCP Cloud Architect Study Guide – Microservices

Serverless Solutions:

Language
Support
TriggersStartup LatencyCost
Cloud Functionnode.js, python, Go, javahttp, Pub/Sub, Cloud Storage, Cloud Firestore, Firebase High, Cold StartNumber of invocations plus tiered usage
App Engine Standardnode.js, python, Go, java, Ruby, PHPhttp using service name, pub/subSecondsTiered usage pricing based on instance size
App Engine Flexnode.js, python, Go, java, Ruby, PHP, .NET, Customn/a – containerized app, limited by the code.MinutesCompute Engine based pricing
Cloud RunAnyn/a – containerized app, limited by the code.MinutesFor Native based on usage

Note: In all cases (except App Engine Flex which runs on Compute Engine), for the services to be able to connect to internal resources using private IP address, Serverless VPC Access must be enabled.

Cloud Functions Best Practices and Notes

  • Design for Indempotency – same result every time
  • Do not call background processes
  • Due to Cold Start limit libraries to only those necessary
  • Use Global Variables
  • Load Global Variables as needed

App Engine Standard Best Practices and Notes

  • Runs in a Sandbox on shared infrastructure
  • Rapid scaling from 0 (when no traffic)
  • App engine specific pricing

App Engine Flex Best Practices and Notes

  • Runs in a Docker Container on dedicated Compute Engine instances
  • Consistent traffic with gradual scaling
  • Cannot scale to 0
  • Compute engine pricing

Cloud Run

  • Cloud Run native seems to be the replacement for App Engine Flex
  • Cloud Run can also run as Cloud Run for Anthos leveraging Knative to provide a serverless environment
  • Can scale to 0 or can be kept at a minimum for faster responses
  • Supports concurrent requests to a given revision if the application supports concurrency

Use Cases for Serverless Solutions

SolutionApplicable Use Cases
App EngineModern Web Applications – Serving basic web content (static and dynamic) to users
Salable Mobile Backends – The backend infrastructure to support mobile applications (gaming, etc.)
Cloud Functions– Trigger Based Notifications – send emails, etc. due based on changes, workflow events.
– Real Time File Processing – Perform actions based on changes in data to new or existing files, generate thumbnailes, validation, aggregate, enhance, transcode, etc.
– Realtime Stream Processing – Enrich, process, transform streaming data from pub/sub from IoT sensors, activity tracking, etc.
Cloud RunContainerized native applications with benefits of serverless architecture
REST API Backend
Lightweight Data Transformation

Comments are closed.