Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Innovation and new features roll-out is now easier when you use the Feature Flags service of the SAP Cloud Platform. With this new service, you can simply switch “ON” and “OFF” your newly developed capabilities via the administrative cockpit of the platform without changing and redeploying the overall solution.

The service is available for productive use with the Cloud Foundry environment of the SAP Cloud Platform since October 2017.

There are many benefits when using the service, such as delivery of latent code, phase roll-out of new features, fast roll-back of faulty feature, and so on. All of them are very important especially when your team is following the lean and agile principles for software development in the cloud.

One of the key benefits that you get with the Feature Flags service is the possibility to align the roll-out of your new features with the business activities of your users. You can simply release them with the flag turned to “off” and switch the flag to “on” immediately when the running business process allows it. This way you can keep the features roll-out independent from the software deployment phases of your overall solution and you will have the freedom to handle your development lifecycle management without complicated boundary conditions of the real-life corporate activities. This can help you to simplify and improve significantly the collaboration of your development team with your business stakeholders.

When you use the Feature Flags service, you can also practice the pilot roll-out of the new capabilities with releasing them first only to certain users or teams and collecting the initial impressions and feedback before doing the general roll-out.

There are also many more important benefits. For example, when your team follows the lean development principals, you usually want to show frequently the progress of your development to your stakeholders. Nevertheless, in many of the cases you have something small ready for release but because it is an integral part of a bigger solution, it is not easy to deploy it separately and show it immediately to your stakeholders. In such situations, the Feature Flags service can help you to show easily only the “ready to go” parts of your new complex solutions, and at the same time to keep the consistency of your code lines and the ability to test and release the small innovation pieces as an integral part of the overall solution.

The Feature Flags service is also helpful when organizing parallel development activities between two or more development teams working on one and the same solution. You can use the service to segregate the responsibilities for development and release of the new features between the development teams and the delivery managers. When your teams are using the Feature Flags service, you can authorize only the delivery managers to be responsible for switching “on” and “off” the approved or signed for delivery capabilities.

If you look further into the benefits, you will realize that an important one is also the possibility to use one click to disable a new faulty feature just deployed and running in the production environment. When you use the Feature Flags service, you can avoid urgent patches and deployments, that can cause unplanned downtime for your production system. You can simply switch “off” the faulty feature, while your production environment is up and running. Then your team can fix the problem, following standard development and end-to-end testing processes, and to release the fix with the next planned solution deployment.

Finally, one of the important advantages of the new Feature Flags service is that it is very easy to use. As a prerequisite, you should first create an instance of the Feature Flags service in the relevant space of the SAP Cloud Platform Cloud Foundry environment of your company. Then you bind your application to the service instance. This will automatically generate credentials data and the URI, necessary to the application for accessing the service instance and will add them in an VCAP environment variable following the Cloud Foundry standard approach. With these two simple steps your application is ready to start consuming the Feature Flags service.

To consume a flag, you need to create it first in the Feature Flags dashboard associated with the service instance. Based on what you what to achieve with this flag, you can choose between two return types for it: Boolean and String. When you want to use a flag for simply switching “on” and “off” a feature without any conditions, you chose the Boolean return type. With such configuration you have only true and false as variations for the returned value of the flag status. This is the straight forward usage scenario - “to show” or “not to show” the feature to the users - covered by the Lite plan of the Feature Flags service, and it is available also for test purposes with the trial accounts of the SAP Cloud Platform.

The advanced capabilities of the Feature Flags service are available with the Standard plan, that can be selected by customers who have SAP Cloud Platform enterprise accounts. With the Standard plan, it is possible to use different variations for the return values and two different delivery strategies: Direct delivery to concrete users, subaccounts, email domain, etc. or Percentage delivery that allows to ship different variations only to predefined percentage of the users. When using such delivery strategies, you can limit, for example, who will be able to see and use the new capabilities or you can control for example the load of your new integration scenarios. It is possible also to combine these two strategies when you want to control the load for different variations but also always to deliver directly some of the variations to certain users, for example, a group of test or pilot users.

For more details how to use and configure variations and strategies for your flags, see Create and Manage Feature Flags.

When you are ready with the flag set-up, you can start using it – to check the flag status and based on this status to show or hide the feature for the user. The consumption of the flags can happen with implementing the so-called toggle points (for example, an if-else statement, or a switch block) in your application logic. You simply wrap a certain application capability with such toggle point and switch it “on” and “off” during runtime of the solution based on the status of the associated flag returned by the Feature Flags service. For more details, see Consume Feature Flags from Your Application

For more details about the overall solution, see Feature Flags Service Documentation.

Related content: Feature variations testing, scheduled and “Canary” release for your newly developed capabilities.