Google Professional Cloud Developer Question 309
Single answerGoogle Cloud PlatformYou are developing a new feature for a web application hosted on Google Cloud. To evaluate the feature’s impact, you want to run an A/B test by serving the new feature to 50% of users while the remaining 50% experience the current version. You plan to use Cloud Load Balancing to route traffic and collect test metrics. What is the best way to implement this A/B test?
- A
Configure a weighted backend service in Cloud Load Balancing to distribute 50% of traffic to the current version and 50% to the version with the new feature.
- B
Deploy two separate Google Kubernetes Engine (GKE) clusters, one for the current version and one for the new version, and use a DNS-based approach to split traffic.
- C
Use Firebase Remote Config to dynamically toggle the feature for 50% of users.
- D
Create two separate Cloud Run services, one for each version, and manually route traffic using client-side logic.
Show answer and explanation
Correct answer: A
Explanation
The best option for implementing A/B testing in a Google Cloud environment is to use a weighted backend service in Cloud Load Balancing. This allows you to split traffic efficiently and monitor the impact of the new feature while leveraging Google Cloud’s scalable infrastructure. Other options introduce unnecessary complexity or are not suitable for server-side A/B testing.
- A. Correct.
This is correct. Using a weighted backend service in Cloud Load Balancing is a scalable and efficient way to split traffic between two versions for an A/B test.
- B. Incorrect.
This is not ideal. Using two separate GKE clusters and DNS-based traffic splitting introduces unnecessary complexity and latency issues.
- C. Incorrect.
This is incorrect. Firebase Remote Config is suitable for feature flagging but is not ideal for routing traffic in a backend A/B test scenario.
- D. Incorrect.
This is incorrect. Manually routing traffic using client-side logic is error-prone and not scalable for backend features.