Google Cloud · Architecture
Reference Architecture for Enterprise Workloads on Google Cloud
Design one complete request path, then prove it can scale, stay secure and recover.
Start with the customer’s order
Harborlane, the illustrative company in this guide, runs a booking application. Customers choose an appointment, pay through an external provider and receive a confirmation. The architecture must explain what happens when any step fails, including a payment that succeeds just before the application times out.
This baseline uses Cloud Run, Cloud SQL and Cloud Storage. Adapt it to your requirements; the useful result is a set of decisions and tests, not a longer product list.
1. Agree the requirements
Harborlane has a stateless HTTP API, relational booking records and uploaded documents. Most customers use one region. Before choosing capacity, record:
- Availability: which customer journeys must work and how success is measured.
- RTO: the longest acceptable recovery time.
- RPO: the maximum acceptable loss of recent data.
- Data location: permitted storage and processing locations.
- Ownership: who operates, funds and approves changes to the service.
Mark unknowns as open decisions. A product’s service-level agreement does not establish the availability of the complete booking journey.
2. Separate production from development
Use separate production and non-production projects. Assign billing, access and audit responsibilities, and make project configuration repeatable. For a broader organization, use the enterprise foundations blueprint as a starting point. Evaluate Shared VPC when a central team needs to manage networking across application projects.
3. Draw the request and data paths
DNS resolves the application’s name. HTTPS requests reach a global external Application Load Balancer, with Cloud Armor at the edge, then a serverless network endpoint group routes them to Cloud Run. The API stores bookings in Cloud SQL and documents in Cloud Storage.
Read the diagram
Customers reach Cloud Run through a load balancer protected by Cloud Armor. The application connects privately to Cloud SQL and accesses Cloud Storage through its API. Identity, delivery, monitoring and recovery controls apply across the whole system.
Review Cloud Run ingress settings and authentication so clients cannot bypass the intended edge. Test the load-balanced route and direct internet access to the default URL separately. Add caching only for content that can safely be shared; private booking responses need different handling.
4. Match compute to the operating model
Cloud Run fits a stateless containerized HTTP service. Choose GKE when Kubernetes APIs or orchestration requirements justify cluster operations; consider Compute Engine when the application needs operating-system control.
Test application concurrency and database connection limits together. More application instances can exhaust the database pool. Include startup time, timeouts and retry behavior in a representative load test.
5. Protect the booking transaction
Cloud SQL provides the relational store in this example. Choose an engine your application supports. Evaluate alternatives such as AlloyDB or Spanner when measured scale, performance or geographic requirements justify the migration.
Cloud SQL’s MySQL regional HA configuration uses primary and standby instances in different zones of one region. Applications must reconnect after failover. Regional HA does not provide a second-region recovery plan.
Give each booking a stable identifier and design duplicate handling. If payment succeeds but recording the booking fails, the team needs reconciliation rather than an automatic second charge.
6. Specify private connectivity
For Cloud Run traffic into the VPC, review Direct VPC egress, subnet capacity and startup behavior. Configure the database’s supported private services access or Private Service Connect path deliberately; these are different mechanisms.
Use the engine-specific Cloud Run–Cloud SQL connection guidance for authentication and pooling. If all outbound traffic uses the VPC, also plan internet access to the external payment provider.
7. Separate deployment and runtime access
Give the service a dedicated runtime identity with only required permissions. Keep the deployment identity separate. Use platform credentials rather than embedding service-account keys in images.
Store third-party credentials in Secret Manager. Test secret-version changes and rollback without logging secret values. Add customer-managed encryption keys only when their lifecycle responsibilities meet a concrete requirement.
8. Make releases reversible
Version infrastructure and configuration. Test an identified image in staging before promoting it from Artifact Registry. Use Cloud Run revisions and gradual traffic migration, comparing booking success, latency and errors before expanding traffic.
Keep a known-good revision and a migration plan: traffic rollback cannot undo a database schema change or a payment. Move confirmation messages to an asynchronous workflow when needed, with explicit retry limits, duplicate handling and failed-work investigation.
9. Monitor the customer journey
Track completed bookings, latency, errors, database connection saturation and failed background work. Carry a correlation identifier through logs and traces without recording sensitive payment details. Each alert needs an affected journey, an owner and a first diagnostic step.
10. Test recovery against RTO and RPO
Rehearse database failover and application reconnection. Restore a backup into a separate destination and verify the data. Document the application, data and traffic changes required for a regional outage.
Record recovery time and the age of recovered data. Compare both with the agreed objectives. A backup, regional HA and cross-region recovery address different failures.
Leave the review with evidence
| Check | Evidence |
|---|---|
| Request path | One traced booking and blocked unintended direct access. |
| Capacity | Load-test results for application scaling and database connections. |
| Recovery | Failover, restore and rollback results with named owners. |
| Operation and cost | A runbook, capacity assumptions, cost estimate and budget recipients. |
Use the Well-Architected Framework to challenge gaps. Then turn the decisions into the production readiness checklist and review actual spending with the FinOps guide.
Official references
- Cloud Run service identity and Secret Manager practices.
- Cloud Run rollout and rollback.
- Disaster recovery planning.
Additional product references appear beside the decisions they support.
