Question

Difficulty: MediumDesigning Infrastructure for Business Requirements and Cost Optimization

A retail company is migrating a legacy web application to Google Cloud. The application consists of a stateless HTTP API backend and a regional relational database that processes standard CRUD transactions. The business requirement is to minimize operational overhead, eliminate baseline infrastructure costs during idle periods, and optimize monthly expenditure while maintaining automatic scaling for peak sales events. Which architectural design best satisfies these requirements?

  1. Deploy the stateless HTTP API on Cloud Run and host the relational database on Cloud SQL for PostgreSQL with high availability.Answer
  2. B
    Deploy the stateless HTTP API on a GKE Standard cluster with Cluster Autoscaler enabled and host the relational database on Cloud SQL for PostgreSQL.
  3. C
    Deploy the stateless HTTP API on Cloud Run and host the relational database on a multi-region Cloud Spanner instance.
  4. D
    Deploy the stateless HTTP API on Compute Engine virtual machines backed by 3-year Committed Use Discounts sized for peak capacity and host the database on Cloud SQL for PostgreSQL.

Answer

Deploying the stateless HTTP API backend on Cloud Run combined with hosting the relational database on Cloud SQL for PostgreSQL best meets the cost optimization and low operational overhead requirements.
Pairing Cloud Run for stateless HTTP services with Cloud SQL for standard regional relational databases optimizes spend by using scale-to-zero serverless compute while avoiding over-provisioned infrastructure or high-cost global database engines.

Step-by-Step Solution

1
Analyze workload compute characteristics and cost model
The API backend is stateless HTTP with fluctuating traffic; Cloud Run scales down to zero instances, eliminating idle compute costs.
Serverless containers suit stateless web APIs with variable load without requiring node management or fixed cluster overhead.
2
Evaluate database requirements against Google Cloud managed database options
The workload requires standard regional relational transactions; Cloud SQL satisfies business requirements cost-effectively.
Cloud Spanner is designed for globally distributed relational databases requiring high horizontal scale and is cost-prohibitive for standard regional workloads.
3
Assess commitment and sizing strategies for cost optimization
Sizing fixed Compute Engine instances with Committed Use Discounts for peak demand causes wasteful spending during normal traffic periods.
Dynamic serverless autoscaling ensures expenditure scales directly with actual request volume.

Key Concept

Selecting cost-effective serverless compute and right-sized managed databases based on workload demand, scale-to-zero capabilities, and operational overhead bounds.
Rate this question