Technical document

Boundary Design When Separating Services in Cloud Run

In a configuration that separates frontend, API, and jobs on Cloud Run, we organize the boundaries of responsibilities, deployment, environment variables, and monitoring.
Cloud / Cloud Run~10 minPublication Date September 22, 2026Update date September 22, 2026
Boundary Design When Separating Services in Cloud Run

Summary

Key points of this document

  • Where are the design challenges?
  • How to define boundaries
  • Details that matter in implementation

Overview

While Cloud Run is easy to start small, putting everything into a single service blurs the units of deployment and monitoring. Criteria are needed to decide what should be separated and what should be grouped. In Cloud Run, simply separating containers results in service division, but the real challenge is deciding where to separate deployment, authentication, monitoring, and data ownership.

Where are the design challenges?

In Cloud Run, deploying a container allows you to run APIs, admin panels, and jobs. However, if you pack too many responsibilities, a minor UI fix might trigger an API redeployment, and a heavy batch job failure could become monitoring noise for regular APIs.

The more services you separate, the more configurations, routing, IAM, and deployment procedures increase. Excessive division at an early stage makes operations cumbersome. Separation should not be an architectural ideal, but rather done when operational independence becomes necessary.

While Cloud Run makes it easy to quickly publish small services, over-separation complicates communication, permissions, logs, and deployment order. Conversely, consolidating too much means frequently changing features become a release risk for the entire system.

How to define boundaries

First, consider separating externally exposed frontends, authenticated APIs, and asynchronous jobs. Create separate services for components that meet multiple conditions such as different change frequencies, different required secrets, different scaling characteristics, or the need to isolate them upon failure.

Boundaries are determined by operational units, not by the API's appearance. Separating components with different scaling conditions or impact upon failure, such as user-facing web, admin APIs, batches, Webhook reception, or heavy transformation processes, makes it easier to leverage Cloud Run's characteristics.

Details that matter in implementation

Even with a common Docker image, Cloud Run services can be separate. Roles can be switched using startup commands or environment variables, and CI/CD deploys only the necessary services based on changes in the target directory. Jobs are defined as Cloud Run Jobs, anticipating both manual and scheduled execution.

In implementation, separate environment variables, service accounts, minimum instances, concurrency, and timeouts for each service. Internal calls should not depend on public URLs; instead, use IAM authentication and correlation IDs to track which requests went to which service in the logs.

  • Acknowledge Webhook receptions with a short timeout, and offload heavy processing to Cloud Tasks or Pub/Sub.
  • Restrict public access points for administrative services and minimize service account permissions.
  • Common libraries are convenient, but don't over-abstract database access or business rules across the board.

Observe how it breaks

During validation, check minimum permissions per service, Secret access scope, rollback procedures, health checks, and log search conditions. Especially for DB migrations and data update jobs, ensure they are idempotent and won't break if re-executed after a partial failure.

During validation, check not only individual health checks but also inter-service timeouts, authentication failures, and scenarios where only one service is updated to a new version. The ability to trace a series of processes using trace_id in logs is also a crucial testing point for post-separation operations.

Discarded options and trade-offs

While separation reduces the scope of failures, it increases dependency management. If inter-service communication increases, you must design for authentication, timeouts, and retries. For simple applications, a monolithic architecture might be safer.

Separation makes it easier to contain the impact of failures, but it increases network latency and the number of operational targets. In the initial stages, it's safer to only separate parts with clearly different scaling conditions or permissions, rather than creating services simply because files are large.

Decision criteria to retain on site

Service division in Cloud Run is not for creating pretty diagrams, but for separately handling changes, permissions, scaling, and failures. The ability to explain the reasons for division in operational terms is the criterion for judgment.

Service division in Cloud Run is not for microservices adoption, but to make units of change and failure easier to manage. Being able to explain the logs, permissions, and deployments after separation is a condition for good boundaries.

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list