Google Cloud Professional Cloud Developer — Question 298
You are the lead developer for a company that provides a financial risk calculation API. The API is built on Cloud Run and has a gRPC interface. You frequently develop optimizations to the risk calculators. You want to enable these optimizations for select customers who registered to try out the optimizations prior to rolling out the optimization to all customers. Your CI/CD pipeline has built a new image and stored it in the Artifact Registry.
Which rollout strategy should you use?
Answer options
- A. Migrate the traffic to the new service by setting Cloud Run’s traffic split based on the percentage of registered customers.
- B. Migrate the traffic to the new service by using a blue/green deployment approach.
- C. Migrate the traffic to the new service by using a feature flag for registered customers.
- D. Migrate the traffic to the new service and enable session affinity for Cloud Run.
Correct answer: C
Explanation
The correct answer is C because using a feature flag allows you to selectively enable the new optimizations for the registered customers without affecting all users. Option A is not suitable as it divides traffic rather than selectively enabling features. Option B, while effective for complete deployments, does not cater to testing for specific users. Option D is irrelevant in this context as session affinity does not facilitate selective feature access.