Google Professional Cloud Developer Question 315
Single answerGoogle Cloud PlatformYou are deploying a new feature for your application using feature flags on Google Cloud. The feature is still in the testing phase and should only be enabled for a small percentage of users. Additionally, you want to have the ability to roll back the feature immediately if issues arise. Which of the following approaches should you use to manage the feature flag effectively?
- A
Implement the feature flag with a configuration stored in a Google Cloud Storage bucket and manually update the bucket file.
- B
Use a feature flag management service that allows gradual rollouts and percentage-based targeting.
- C
Hard-code the feature flag in your application code and redeploy the application to toggle the feature.
- D
Use a Google Cloud Pub/Sub topic to broadcast feature flag changes to all services in real-time.
Show answer and explanation
Correct answer: B
Explanation
Using a dedicated feature flag management service is the best approach for managing feature flags during feature rollouts. These services enable you to control the feature's exposure dynamically, perform gradual rollouts, target specific user groups, and quickly roll back the feature if needed. Other options, such as hard-coding or using Cloud Storage, lack the flexibility and efficiency required for such scenarios.
- A. Incorrect.
This option involves manual intervention and lacks the ability to manage gradual rollouts or percentage-based targeting effectively. It is not suitable for dynamic feature flag management.
- B. Correct.
This is the correct answer, as a feature flag management service provides the necessary tools for gradual rollouts, targeting specific user groups, and quick rollbacks.
- C. Incorrect.
Hard-coding the feature flag in the application code requires redeployment to make changes, which is time-consuming and not ideal for dynamic feature management.
- D. Incorrect.
While Pub/Sub can distribute real-time updates, it is not designed for managing feature flags and does not natively support gradual rollouts or percentage-based targeting.