Question

Difficulty: MediumDesigning Infrastructure for Business Requirements and Cost Optimization

An enterprise e-commerce organization runs a batch inventory reconciliation process every night at midnight. The job runs a single containerized application for approximately 45 minutes to reconcile stock levels across multiple warehouses and stores the transactional results in a database requiring standard relational capabilities within a single GCP region. The system currently utilizes a dedicated multi-node Google Kubernetes Engine (GKE) cluster and a Cloud Spanner instance. The engineering team needs to optimize infrastructure costs while maintaining high availability and operational reliability for this regional batch workload. Which TWO architectural modifications should a Cloud Architect recommend to minimize costs?

  1. Migrate the nightly containerized reconciliation batch job from GKE to Cloud Run jobs.Answer
  2. Migrate the database layer from Cloud Spanner to a regional Cloud SQL for PostgreSQL instance configured for High Availability (HA).Answer
  3. C
    Maintain the GKE cluster but convert it to a dedicated GKE Autopilot cluster covered by 3-year Compute Engine Committed Use Discounts (CUDs).
  4. D
    Retain Cloud Spanner and configure multi-region dual-region read replicas to reduce transactional latency.

Answer

Migrate the nightly containerized reconciliation batch job from GKE to Cloud Run jobs, and migrate the database layer from Cloud Spanner to a regional Cloud SQL for PostgreSQL instance configured for High Availability (HA).
The combination of Cloud Run jobs and Cloud SQL for PostgreSQL HA optimizes costs across both compute and database tiers. Cloud Run jobs execute containerized batch tasks without paying for idle cluster resources between executions. Cloud SQL provides full relational transactional support in a single region with high availability without the premium price tag of Cloud Spanner.

Step-by-Step Solution

1
Analyze compute workload requirements for batch execution
Identified that running a 45-minute nightly job on an always-on GKE cluster incurs unneeded continuous compute and management costs. Cloud Run jobs provide serverless execution that scales to zero when idle.
Serverless containers eliminate idle compute expenses for intermittent, scheduled batch processing.
2
Analyze storage and database requirements against cost and scale boundaries
Identified that Cloud Spanner provides horizontal global scaling which exceeds the needs of a single-region relational workload. Cloud SQL for PostgreSQL HA delivers the needed ACID compliance and availability at a fraction of the cost.
Right-sizing database choices to match workload regional requirements prevents costly over-provisioning.

Key Concept

Cost Optimization through Serverless Compute and Relational Database Right-Sizing
Rate this question