Platform engineering with Cloud Run

Google Cloud TechAbout 4 min readApr 4, 2025Watch original
THE SUMMARYAI-generated

Key Concepts:

  • Etsy Service Platform (ESP): A platform built on Google Cloud to simplify service creation and management for Etsy developers.
  • Platform Engineering: The discipline of designing and building toolchains and workflows that reduce the cognitive load on developers.
  • Cloud Run: A serverless execution environment on Google Cloud that automatically scales containerized applications.
  • CI/CD: Continuous Integration and Continuous Delivery, automated processes for building, testing, and deploying code.
  • Observability: The ability to understand the internal state of a system based on its outputs (e.g., logs, metrics, traces).
  • Protobuf: Protocol Buffers, a language-neutral, platform-neutral extensible mechanism for serializing structured data.
  • gcloud: Google Cloud CLI, a command-line tool for interacting with Google Cloud services.
  • grpcurl: A command-line tool for interacting with gRPC services.
  • Docker image: A lightweight, standalone, executable package that includes everything needed to run a piece of software, including the code, runtime, system tools, system libraries, and settings.

Etsy's Engineering Challenges and Google Cloud Solution

  • Growth and Scaling: Etsy has experienced rapid revenue growth since 2019, nearly tripling in size. This growth presented significant engineering challenges, particularly for SRE and platform teams.
  • Developer Productivity: Scaling up dev teams required ensuring engineers could focus on code and business features rather than infrastructure management.
  • Google Cloud's Role: Google Cloud provided the flexibility and building blocks needed to create a platform tailored to Etsy's engineering workflows.

Etsy Service Platform (ESP)

  • Purpose: ESP was created to extract common infrastructure tasks and tools, preventing engineers from repeating them for each new service.
  • Out-of-the-Box Features: ESP provides observability, CI/CD, and security features, allowing developers to concentrate on coding.
  • Platform Engineering: ESP is an example of platform engineering, aiming to reduce the cognitive load on developers by providing a streamlined and automated environment.

Creating a New Service with ESP: A Step-by-Step Example

  • Scenario: A developer needs to create a new service to calculate shipping discounts.
  • One-Time Setup: Install the platform on your computer using a Git clone.
  • ESP Command-Line Tool: Use the ESP command-line tool to create the service.
    1. esp init Command: Scaffolds the new shipping service, setting up a new service on the machine and including a boilerplate protobuf definition file.
      • Protobuf Definition: Defines the structure of messages the service will use and the endpoints it will expose.
      • Example: A CalculateDiscountRequest message with product ID and promotion integers, and a CalculateDiscountResponse message containing the discount percentage.
    2. esp generate Command: Generates templates for coding in the chosen language (e.g., Go).
      • Installs necessary packages and creates files needed to build and run the service.
      • Provides auto-generated code stubs for developers to add business logic.
      • Example: The service might return a discount of 30% for product ID 100, 40% for product ID 200, and 0% otherwise.
    3. esp run Command: Runs the service locally.
      • Assembles service components into a Docker image.
      • Runs the service in a local container.
    4. grpcurl Command: Invokes the service with different arguments to test its functionality.
  • Deployment to Google Cloud:
    • esp deploy Command: Deploys the service to Cloud Run in a special sandbox environment.
    • Containerizes the service and uses gcloud commands to deploy it to Cloud Run.

Cloud Run as the Chosen Runtime

  • Evaluation: Etsy considered multiple runtime options but chose Cloud Run for its simplicity and elegance.
  • Benefits: Cloud Run handles the complexity of running containerized services, decoupling infrastructure from business logic.
  • Stateless Services: Cloud Run was particularly well-suited for Etsy's stateless service use cases.

Kubernetes Consideration

  • Alternative: Kubernetes was considered but deemed less suitable for quickly launching a platform that could handle the majority of service use cases.
  • Focus on Core Features: Cloud Run's container management capabilities allowed the team to focus on core platform features and developer experience.

Cloud Run in Production

  • Stability: Cloud Run has been very stable in production for almost two years.
  • Incident: One short incident impacted the performance of some services, but Google support helped resolve the issue.

Notable Quotes

  • Corey Samuels: "Google Cloud has made scaling and operations much easier."
  • Corey Samuels: "Cloud Run takes care of a lot of the complexity of running containerized services... Cloud Run really helped us quickly achieve the goal of decoupling the infrastructure from the business logic of the service."

Synthesis/Conclusion

Etsy successfully leveraged Google Cloud, particularly Cloud Run, to build its Etsy Service Platform (ESP). ESP streamlines service creation and management for developers by abstracting away infrastructure complexities and providing out-of-the-box features like observability and CI/CD. Cloud Run's simplicity and stability have enabled Etsy to scale its engineering efforts and focus on core business features, demonstrating the value of platform engineering and serverless technologies in a high-growth environment.

AI summaries can miss context or contain errors. Check important details against the original video.

MAKE IT YOURS

Read. Remember. Reuse.

Free tools

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.