3.1.4. Serverless Compute and Event-Driven Architectures
💡 First Principle: Serverless compute on Google Cloud isn't only about "not managing servers" — its deeper value is native integration with Google Cloud's event system, letting code run automatically in direct response to something happening elsewhere in the platform, with no polling or manual triggering required.
Cloud Run deploys any container and scales it automatically (including to zero when idle), suiting HTTP-driven services or long-running background processing. Cloud Run functions deploys source code directly (Google builds the container for you) and is purpose-built for short, event-triggered logic. Both can be triggered by Google Cloud events: Pub/Sub events (a message published to a topic triggers a function), Cloud Storage object change notification events (a file upload or deletion triggers processing), and Eventarc, which unifies event routing from over 90 Google Cloud sources into a consistent trigger mechanism for both Cloud Run and Cloud Run functions.
⚠️ Exam Trap: Cloud Run and Cloud Run functions are the same product under two names — a natural assumption given the shared branding, but Cloud Run deploys arbitrary containers you build, while Cloud Run functions is a source-based, event-driven FaaS model; they share a brand but not a deployment model, and the exam expects you to pick the one matching the described deployment artifact (a container image versus a function's source code).
Reflection Question: A scenario describes code that should run automatically every time a new file lands in a specific Cloud Storage bucket, with no polling involved. Which two Google Cloud features work together to make that happen, and what role does each play?