Cost-effective, highly reliable web app with Cloud Load Balancing

PCA By islever Editorial Last updated

Short answer

C Store static content in Cloud CDN, host the public APIs on Cloud Run, and save user data in Cloud SQL, all behind Cloud Load Balancing.

Question

Your company wants you to build a highly reliable web application with a few public APIs as the backend. You don't expect a lot of user traffic, but traffic could
spike occasionally. You want to leverage Cloud Load Balancing, and the solution must be cost-effective for users. What should you do?
  1. Store static content such as HTML and images in Cloud CDN. Host the APIs on App Engine and store the user data in Cloud SQL.
  2. Store static content such as HTML and images in a Cloud Storage bucket. Host the APIs on a zonal Google Kubernetes Engine cluster with worker nodes in multiple zones, and save the user data in Cloud Spanner.
  3. Store static content such as HTML and images in Cloud CDN. Use Cloud Run to host the APIs and save the user data in Cloud SQL. Correct Answer
  4. Store static content such as HTML and images in a Cloud Storage bucket. Use Cloud Functions to host the APIs and save the user data in Firestore.

Key Takeaways

The question tests whether you can match Google Cloud's serverless, pay-per-use services to unpredictable traffic; the common trap is defaulting to always-on managed offerings like a GKE cluster or Cloud Spanner, which destroy the cost-effectiveness requirement.

This PCA scenario asks how to architect a highly reliable web application with a few public APIs, low baseline traffic, and occasional spikes, while leveraging Cloud Load Balancing and staying cost-effective. The correct answer pairs Cloud CDN for static assets, Cloud Run to host the APIs, and Cloud SQL for user data behind an HTTP(S) load balancer.

Common mistake: Learners most often pick D (Cloud Storage + Cloud Functions + Firestore) or B (GKE + Cloud Spanner). B is rejected because an always-running zonal GKE cluster plus Cloud Spanner is far too expensive for a low-traffic app, while D fails because Cloud Functions is designed for short-lived event-driven work, not public API endpoints.

Expert Analysis

Why the Answer Is Correct

Option C satisfies every constraint simultaneously. The question explicitly requires leveraging Cloud Load Balancing, and Cloud CDN is only meaningful in front of an HTTP(S) Load Balancer backend service — so static HTML and images are served from Google's edge cache, cutting latency and origin load. Cloud Run is the most cost-effective compute choice for a low-traffic API that must absorb spikes: it scales from zero, bills only per-request and per-vCPU-time, and is fully managed with multi-zone availability baked in. Cloud SQL in a regional HA configuration provides managed relational storage for user data with synchronous replication and automatic failover, delivering the "highly reliable" guarantee at a fraction of Cloud Spanner's cost. No option balances reliability, spike tolerance, load balancing, and cost as cleanly as C.

Why the Other Options Are Wrong

Option B pairs a zonal GKE cluster with Cloud Spanner, both priced for steady-state, high-throughput workloads — an always-on cluster plus a globally distributed relational database is wildly disproportionate to "a few public APIs" with occasional spikes. Option A uses Cloud CDN and Cloud SQL correctly but selects App Engine for the APIs; while App Engine Standard can scale to zero, Cloud Run is Google's current recommended serverless container platform and is more portable and typically cheaper. Option D is the strongest counter-argument in the comments because Cloud Storage is a legitimate static origin and Firestore is cheaper than Spanner, but Cloud Functions is purpose-built for short-lived, event-driven work rather than long-running or stateful public API endpoints, and Firestore is a NoSQL document store that may not fit relational user data the way Cloud SQL does.

Community Comment Notes

TotoroChina, XDevX, and diluviouniv lean toward D, with XDevX noting "you don't need Cloud Spanner just to store user data" and diluviouniv simply stating "Spanner is expensive" — both observations about B are correct but don't make D superior. MaxNRG and JC0926 push back, with vincy2202 arguing "Cloud Functions is not an apt solution to host public API's" and that "Cloud Run will take care of the odd load spikes & would be economical too." Letonphat raises a technically valid point that "CDN is not storage solution to store static html or image" — true in the strict sense, but the CDN's origin in practice is a Cloud Storage bucket, so the phrasing is exam shorthand rather than a flaw in the option.

Official Reference

Exam Strategy

When a question combines "cost-effective," "occasional spikes," and "Cloud Load Balancing," immediately narrow to serverless options (Cloud Run, Cloud Functions) paired with an HTTP(S) load balancer. Then eliminate any choice that pairs a globally distributed database (Spanner) or always-on cluster (GKE) with low, spiky traffic — that's the cost trap.

Frequently Asked Questions

Why isn't Cloud Storage a better choice than Cloud CDN for the static content here?

Cloud CDN caches content at Google's edge locations and integrates directly with the HTTP(S) Load Balancer the question requires, delivering lower latency and higher reliability than serving straight from a bucket.

Why is Cloud Run preferred over Cloud Functions for hosting the public APIs?

Cloud Run is purpose-built for containerized HTTP services with longer request timeouts and streaming, whereas Cloud Functions targets short-lived event-driven workloads and isn't ideal for public API backends.

More PCA FAQ →

Discussion 108 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 30 of 108

  1. TotoroChina 👍 55
    Answer should be D, https://cloud.google.com/load-balancing/docs/https/setting-up-https-serverless#gcloud:-cloud-functions https://cloud.google.com/blog/products/networking/better-load-balancing-for-app-engine-cloud-run-and-functions
  2. XDevX 👍 18
    IMHO it is d), not b). Reason is that you don't need Cloud Spanner just to store user data - FireStore is the better solution. Additionally, I see no indications concerning the requirement to use GKE... Please correct me when I am wrong.
  3. diluviouniv 👍 10
    Spanner is expensive
  4. mikesp 👍 8
    IMHO, i agree with you. Furthermore: Cloud Storage buckets are a good choice for static web content. Cloud storage buckets behave like a CDN Network: https://cloud.google.com/storage/docs/caching So it is lower cost than CDN.
  5. MaxNRG 👍 7
    Today passed the exam, I choose C Cloud CDN + Cloud Run
Show 25 more comments
  1. MaxNRG 👍 6
    B is not cost-effective - GKE + Spanner is very expensive So, A or C - Cloud CDN + App Engine or Cloud CDN + Cloud Run Since Cloud Run is serverless it is more cost-effective as compared to App Engine, so C. https://cloud.google.com/hosting-options https://dev.to/pcraig3/cloud-run-vs-app-engine-a-head-to-head-comparison-using-facts-and-science-1225 Cloud CDN uses HTTP(S) Load Balancing as the origin for cacheable content. An external HTTP(S) load balancer can deliver a mix of static and dynamically-created content to users through one global IP address from the following types of backends: • Instance groups • Zonal network endpoint groups (NEGs) • Serverless NEGs: One or more App Engine, Cloud Run, or Cloud Functions services • Internet NEGs for external backends • Buckets in Cloud Storage https://cloud.google.com/cdn/docs/best-practices
  2. PeppaPig 👍 6
    CDN is not needed here. You don't need to service users globally thus latency and locality isn't critical
  3. JC0926 👍 5 Answered C
    Explanation: Cloud CDN: By using Cloud CDN, we can cache static content like HTML, images, and other files across Google's edge locations, which will make the delivery of the static content faster and more reliable. This will help in reducing the latency for users and also minimize the load on our web servers. Cloud Run: Cloud Run provides an easy-to-use platform for hosting stateless HTTP-driven containers. It can automatically scale up or down based on traffic demand, making it perfect for handling occasional traffic spikes. Cloud Run is also a cost-effective option since we only pay for the compute resources used when the application is running. Cloud SQL: Cloud SQL provides a managed relational database service that is highly available and scalable. It supports automatic failover and backups, ensuring that our user data is safe and available at all times.
  4. vincy2202 👍 5 Answered C
    C is the correct answer Cloud Function is not an apt solution to host public API's. Cloud CDN along with HTTPS Load Balancer with public API's hosted on Cloud Run seems to be the perfect solution. Cloud Run will take care of the odd load spikes & would be economical too. Option A also seems to be a good solution, however Cloud Run would be a more cost effective solution as compared to App engine. https://cloud.google.com/blog/products/networking/better-load-balancing-for-app-engine-cloud-run-and-functions
  5. letonphat 👍 5
    IMHO CDN is not storage solution to store static html or image
  6. BrunoTostes 👍 5
    but is it Cloud Functions used for hosting APIs?
  7. MamthaSJ 👍 5
    D is correct answer.
  8. OctavioBatera 👍 4 Answered B
    People, i would go with B, and this is why: In my humble opinion, the line "...cost-effective for users" is just intended to misleanding the candidate, because if i'm a user of the web application, why should I be concerned on how expensive the infrastructure is, right? Besides, I think that A, C and D aren't valid technical solutions: A and B- Cloud CDN is for caching and delivering the content to user with low latency, but not for store it, the files would still be stored in a Cloud Storage Bucket. D - I ruled out because Cloud Functions is not optimal for host de APIs (https://cloud.google.com/blog/topics/developers-practitioners/where-should-i-run-my-stuff-choosing-google-cloud-compute-option)
  9. convers39 👍 4 Answered D
    CDN is for caching. For static website hosting a storage bucket is a good choice, thus A and C are eliminated. B, Cloud Spanner, my nightmare. I accidentally created an empty cloud spanner and it burned like 30-40 USD per day! I got a huge amount of billing from GCP that month! No way to be cost-effective. D, Cloud Functions are good for simple API services and have no cost if not in use. SQL or NoSQL for user data is not a strong factor here, either should be fine.
  10. amxexam 👍 4
    I would prefer CDN over Cloud Storage Bucket and Cloud function over AppEngine and Cloud Run. As per the requirement, we need LB and there is a spike in traffic, so the solution must scale. We cannot use LB with CloudFunctions. I will go with CDN and App Engine or Cloud Run, putting both through price calculator cloud run is more cost-effective. I will go with C
  11. telp 👍 4 Answered D
    Answer D static content html and images => cloud storage so A and B are eliminated. The b is so expensive for the need of a few call API. The cloud function can be used to answer API calls if there are a few calls and can scale if needed. For user data storage, the recommended database for google is firestore.
  12. VishalB 👍 4
     Correct Answer: C o For Static content such as images Cloud Storage bucket is the preferable options which is also cost effective, hence A & C option with Cloud CDN gets eliminated o Cloud Spanner is expensive solution over Firestore hence B gets eliminated, So I would go with option D
  13. turbo8p 👍 4
    Can be hosted. It's cost effective since you get charged on per call basis. If no traffic then no cost will be charged.
  14. kopper2019 👍 4
    D is the way to go you can spot the answer just seeing Firestore mention for user data
  15. gonlafer 👍 4 Answered B
    Cloud functions is not for host API Cloud CDN does not store. Therefore B
  16. Arun_m_123 👍 3 Answered D
    D is the correct answer 1. Cloud CDN is not meant for storing contents. It can only cache but not act as the source-of-truth and moreover the question tells that the user traffic is less. Cloud CDN performs better when the user traffic is high 2. The spikes are very rare and the app gets low traffic most of the time. That said, putting a cluster is an expensive option. choosing a serverless supported app-platform (Cloud Run) and serverless supported DB (Firestore) makes perfect choice here to handle cost during low traffic and also handle any incoming sudden spikes
  17. apb98 👍 3 Answered C
    C. Even though Cloud CDN is not a storage system, option C implies that static content is served through a CDN-enabled LB (usually backed by Cloud Storage). This fits well with the requirement for cost-efficiency, scalability, and LB. Option D is valid too, but it doesn’t mention LD and uses Firestore, which may not fit structured user data. Therefore, C remains the best match for Google’s exam logic.
  18. JC0926 👍 3
    Cloud Functions: While Cloud Functions is a serverless compute platform that is easy to use, it is not ideal for hosting APIs that require long-running connections, such as WebSockets. Cloud Functions are designed to run short-lived tasks in response to events, so they may not provide the best performance for API endpoints that need to handle a lot of traffic.
  19. Papafel 👍 3
    Yes IMO the correct answer is D. Don't need GKE and Spanner to do the job it is too expensive. Cloud Storage bucket, Cloud Functions and Firestore will do.
  20. wilwong 👍 3 Answered D
    Cloud CDN is a cache service not a Storage service, So A and C is wrong. B is not cost Effect. D is the Best choice
  21. kahuja0908 👍 3 Answered C
    Cloud CDN + Cloud Run + Cloud SQL = Cost-effective, reliable, and scalable.
  22. Gofu 👍 3 Answered A
    Why not A . App engine standard can handle sudden spike in traffic
  23. zbyszekz 👍 3
    load balancer can operate with Cloud Functions
  24. sshetty 👍 3
    Answer Should be C Cloud Run + CDN
  25. Andrea67 👍 3
    agree with u

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All PCA Questions

Access 81 questions with complete answers and detailed explanations.

View Full PCA Practice Test →

← Back to PCA Study Guide