Learn the best rollout strategy for enabling new optimizations on a Cloud Run API for select registered customers before rolling out the changes to all users. Understand how feature flags can help you safely test optimizations.
Table of Contents
Question
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?
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.
Answer
C. Migrate the traffic to the new service by using a feature flag for registered customers.
Explanation
When you want to enable new optimizations or features for only a subset of users, such as registered customers who opted-in to try them, the best approach is to use feature flags. Feature flags allow you to selectively enable or disable functionality for specific users or groups without having to maintain multiple versions of your application or API.
With feature flags, the new optimized code is deployed to the same Cloud Run service that serves all customers. However, the new code path is only executed for requests coming from registered customers, based on the feature flag. This allows those selected customers to access the new optimizations, while all other customers continue using the existing stable functionality.
Using traffic splitting or blue/green deployments would route a percentage of all traffic to the new version, which is not ideal when you only want registered customers to access it. And enabling session affinity would ensure that a given client always gets routed to the same service instance, but wouldn’t provide selective access to new features.
Therefore, using a feature flag is the optimal strategy here for rolling out the new risk calculator optimizations to select registered customers on the Cloud Run API, before later removing the flag to enable the optimizations for everyone once they are fully validated. The feature flag allows safely testing the changes with real usage by opted-in users.
Google Professional Cloud Developer certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Google Professional Cloud Developer exam and earn Google Professional Cloud Developer certification.