{"id":2897,"date":"2020-09-24T11:19:20","date_gmt":"2020-09-24T11:19:20","guid":{"rendered":"https:\/\/alternative-spaces.com\/blog\/?p=2897"},"modified":"2023-05-12T09:12:34","modified_gmt":"2023-05-12T09:12:34","slug":"introduction-to-feature-flags-in-java-using-the-spring-boot-framework","status":"publish","type":"post","link":"https:\/\/alternative-spaces.com\/blog\/introduction-to-feature-flags-in-java-using-the-spring-boot-framework\/","title":{"rendered":"Introduction to Feature Flags in Java Using the Spring Boot Framework"},"content":{"rendered":"\n<p> Feature flag (also known as feature toggle or feature switch) is a technique that allows separating feature release from deploying code during software development. That way, an application is under full control since developers can set who sees its features and when. This makes feature toggles integral to the continuous delivery approach which facilitates quick and reliable releases. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/03gpWMCmR39eRkcIe59cZoY2NAfJzKTd-1024x723.jpg\" alt=\"\" class=\"wp-image-2902\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/03gpWMCmR39eRkcIe59cZoY2NAfJzKTd-1024x723.jpg 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/03gpWMCmR39eRkcIe59cZoY2NAfJzKTd-150x106.jpg 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/03gpWMCmR39eRkcIe59cZoY2NAfJzKTd-300x212.jpg 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/03gpWMCmR39eRkcIe59cZoY2NAfJzKTd-768x542.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The credits for introducing the concept of feature flagging go to&nbsp;<a href=\"https:\/\/martinfowler.com\/articles\/feature-toggles.html\" target=\"_blank\" rel=\"noreferrer noopener\">Martin Fowler<\/a>&nbsp;and Facebook\u2019s development team. Feature toggles were presented as an alternative to feature branches, i.e. maintaining multiple source-code branches. Feature branches make feature releases tied to code deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Feature Flags Work<\/strong><\/h2>\n\n\n\n<p>When marketers are targeting users based on various attributes \u2014 age, location, gender, etc. \u2014 they want to ensure the information they want to share gets to the specific users. Thus, user targeting gives control over what is shared, with whom, and when. Something similar happens with feature flagging.&nbsp;<\/p>\n\n\n\n<p>When a web application loads, it will use the specific user\u2019s attributes to determine what features will be shown. For example, canary launches imply a specific feature functioning only for a small group of users. The group can be chosen from the internal users, or based on demographics, or deliberately at random; it varies from company to company.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/uzzkEQu88HXjPX1B8M-8juvCBe6S-o1d-1024x723.jpg\" alt=\"\" class=\"wp-image-2903\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/uzzkEQu88HXjPX1B8M-8juvCBe6S-o1d-1024x723.jpg 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/uzzkEQu88HXjPX1B8M-8juvCBe6S-o1d-150x106.jpg 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/uzzkEQu88HXjPX1B8M-8juvCBe6S-o1d-300x212.jpg 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/uzzkEQu88HXjPX1B8M-8juvCBe6S-o1d-768x542.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That way, after logging in, all the \u2018canaries\u2019 will see the newest features firsthand. The other users won\u2019t see anything new yet. With time, when new features prove their efficiency, they will be gradually introduced to a larger audience. If new features prove to be less than hoped for, they can be turned off.<\/p>\n\n\n\n<p>According to Martin Fowler,&nbsp;<a href=\"https:\/\/martinfowler.com\/bliki\/FeatureToggle.html\" target=\"_blank\" rel=\"noreferrer noopener\">feature toggles can be classified<\/a>&nbsp;as follows:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Release toggles.<\/strong>&nbsp;These toggles are used to hide incomplete features from groups of users or from all users.&nbsp;<\/li><li><strong>Experiment toggles.<\/strong>&nbsp;This type is used for A\/B testing.<\/li><li><strong>Ops toggles.<\/strong>&nbsp;These toggles are used to control the operational aspects of a system.<\/li><li><strong>Permissioning toggles.<\/strong>&nbsp;This type is used to manage what features are available for different groups of users (e.g., premium users).<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Feature Flags in Java<\/strong><\/h2>\n\n\n\n<p>Feature flags in Java work by the same principle \u2014 they help when it\u2019s still too early to introduce new features in a Java application, or if they should be available, only for specific users. Reasons may vary. For example, the business or application itself, might not be ready.\u00a0 So it is handy to add a specific feature toggle and default it to \u2018off\u2019 until it is needed.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/HvSjlyxQBZjCvzZ8V41R0CYDKmoN5rIl-1024x723.jpg\" alt=\"\" class=\"wp-image-2904\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/HvSjlyxQBZjCvzZ8V41R0CYDKmoN5rIl-1024x723.jpg 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/HvSjlyxQBZjCvzZ8V41R0CYDKmoN5rIl-150x106.jpg 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/HvSjlyxQBZjCvzZ8V41R0CYDKmoN5rIl-300x212.jpg 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/HvSjlyxQBZjCvzZ8V41R0CYDKmoN5rIl-768x542.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Also, there are feature toggle management tools that allow adding feature toggles to improve the code. When the development team opens the code and changes it, it\u2019s not Java flags at work, it\u2019s a release deployment. Sometimes, release deployment is chosen over feature switches whose main drawback is a higher level of complexity.&nbsp;<\/p>\n\n\n\n<p>There are two ways to prevent feature switches from becoming unmanageable:<\/p>\n\n\n\n<p><strong>1. Prevent feature flag coupling.<\/strong>&nbsp;This means all values of feature toggles should be put into a particular class. That class will work as a single source of truth. It gives greater freedom and flexibility since it is possible to replace feature toggles storage with a database. It is also possible to implement switching flags in runtime.<\/p>\n\n\n\n<p><strong>2. Extracting feature toggles in Spring Boot.<\/strong>&nbsp;When there is a separate bean for all feature toggles, it is possible to insert Spring flags from the&nbsp;<em>application.properties<\/em>&nbsp;file through the&nbsp;<em>@ConfigurationProperties<\/em>&nbsp;annotation.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Feature Flags with Spring Boot<\/strong><\/h2>\n\n\n\n<p>Spring Boot is an open-source framework based on Java. This project is built on the Spring framework and allows running various types of applications more swiftly and simply. Some remarkable Spring Boot features are:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Intelligent auto-configuration.&nbsp;<\/strong>Spring Boot analyzes the environment and developers\u2019 hints to set an application based on that data.<\/li><li><strong>Standalone.<\/strong>&nbsp;Spring Boot has no attachment to web servers or any special environments.<\/li><li><strong>Opinionated.<\/strong>&nbsp;That feature loads and configures the most often used libraries in the most typical way. Often, that means that developers need not do it manually every time and save time for coding.<\/li><\/ol>\n\n\n\n<p>As was mentioned before, feature toggles allow web developers to disable some functions of a web application in development. The best thing about Spring toggle is that developers need not redeploy the app or even change the code. Some feature toggles work globally, so when you configure them, they stop or start working for the whole application, but some of them can be disabled or enabled per request or per user. The development process requires using the simplest approach to resolving a problem. Feature toggles can come in handy because using them removes some unnecessary complications.<\/p>\n\n\n\n<p>Smartly used feature toggles can stabilize the development process, while misusing them can add even more complication and trouble. Developers should know what they are doing and why.&nbsp;<\/p>\n\n\n\n<p>Feature flags may be used in the following scenarios:&nbsp;<\/p>\n\n\n\n<p>1. Nontrivial features that are used in trunk-based development. When frequent integration is required, sometimes it is not possible to release some bits of functionality. The use of feature flags can help to proceed with release without making changes available until they are complete.<\/p>\n\n\n\n<p>2. A\/B testing. When using feature switches, it is possible to release different solutions to a single problem and see what works best.&nbsp;<\/p>\n\n\n\n<p>3. Canary releasing. The release of new features may be gradual, starting with a small group of users and continuously expanding, if the features behave correctly. That can be done using feature toggles.<\/p>\n\n\n\n<p>4. Feature flags can be used to toggle the right setup for the right environment.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Feature Flag Technique Using Spring Boot<\/strong><\/h2>\n\n\n\n<p>There are many ways to implement feature toggles, but the most common is to activate one or another implementation of some interface. Which depends on the value of the feature flag.<\/p>\n\n\n\n<p><strong>1. application.yml and @ConditionalOnProperty&nbsp;<\/strong><\/p>\n\n\n\n<p>It is very convenient to use\u00a0<em>application.yml<\/em>\u00a0for feature flags in Spring Boot apps. This file usually defines the configuration of an application and simultaneously can be a perfect place for feature\u00a0toggles:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"107\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Xp1Rp1gkSnS2-quhhqLnX_FZQaangxwv-1024x107.png\" alt=\"\" class=\"wp-image-2905\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Xp1Rp1gkSnS2-quhhqLnX_FZQaangxwv-1024x107.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Xp1Rp1gkSnS2-quhhqLnX_FZQaangxwv-150x16.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Xp1Rp1gkSnS2-quhhqLnX_FZQaangxwv-300x31.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Xp1Rp1gkSnS2-quhhqLnX_FZQaangxwv-768x80.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Xp1Rp1gkSnS2-quhhqLnX_FZQaangxwv.png 1025w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The next step requires turning on some implementation options of the feature, depending on the flag\u2019s value.\u00a0<em>@ConditionalOnProperty<\/em>\u00a0annotation is used for this.\u00a0 <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"510\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/58qN4izL3-dAcJwsmrgZGb15Wc9IHUqf-1024x510.png\" alt=\"\" class=\"wp-image-2906\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/58qN4izL3-dAcJwsmrgZGb15Wc9IHUqf.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/58qN4izL3-dAcJwsmrgZGb15Wc9IHUqf-150x75.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/58qN4izL3-dAcJwsmrgZGb15Wc9IHUqf-300x149.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/58qN4izL3-dAcJwsmrgZGb15Wc9IHUqf-768x383.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If the\u00a0<em>feature-flags.is-new-books-service-enabled<\/em>\u00a0value is\u00a0<em>-false<\/em>, or there is no such flag in the configuration, an object from the class\u00a0<em>BooksDefaultService<\/em>\u00a0will be created. For the\u00a0<em>-true<\/em>\u00a0value, an object from the class<em>\u00a0BooksNewService<\/em>\u00a0will be created. This is what those classes look like: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"345\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oYDpZ09e9o2uQ1W7zuKy4BSMJv62JkBL.png\" alt=\"\" class=\"wp-image-2907\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oYDpZ09e9o2uQ1W7zuKy4BSMJv62JkBL.png 1020w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oYDpZ09e9o2uQ1W7zuKy4BSMJv62JkBL-150x51.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oYDpZ09e9o2uQ1W7zuKy4BSMJv62JkBL-300x101.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oYDpZ09e9o2uQ1W7zuKy4BSMJv62JkBL-768x260.png 768w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><\/figure>\n\n\n\n<p>Now, it is possible to use an object of\u00a0\u00a0<em>BookService<\/em>\u00a0interface with actual implementation (polymorphism in action): <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"175\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/F-Gqg4S25oJO127PPo7Wv-OiGqFfhtw6.png\" alt=\"\" class=\"wp-image-2908\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/F-Gqg4S25oJO127PPo7Wv-OiGqFfhtw6.png 1023w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/F-Gqg4S25oJO127PPo7Wv-OiGqFfhtw6-150x26.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/F-Gqg4S25oJO127PPo7Wv-OiGqFfhtw6-300x51.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/F-Gqg4S25oJO127PPo7Wv-OiGqFfhtw6-768x131.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<p>Sometimes, there is a need to turn off the controller itself. It is done the same way through the\u00a0<em>@ConditionalOnProperty<\/em>\u00a0annotation: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"245\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/GD8p4dbsJKQ4ZJf9HLtNXMOPALE5upTa.png\" alt=\"\" class=\"wp-image-2909\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/GD8p4dbsJKQ4ZJf9HLtNXMOPALE5upTa.png 1023w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/GD8p4dbsJKQ4ZJf9HLtNXMOPALE5upTa-150x36.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/GD8p4dbsJKQ4ZJf9HLtNXMOPALE5upTa-300x72.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/GD8p4dbsJKQ4ZJf9HLtNXMOPALE5upTa-768x184.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<p>That way, if the value of&nbsp;<em>feature-flags.is-new-books-service-enabled<\/em>&nbsp;is&nbsp;<em>-false<\/em>, or such a flag doesn\u2019t exist in&nbsp;<em>application.yml<\/em>, the request&nbsp;<em>\/books<\/em>&nbsp;will return the 404 error.<\/p>\n\n\n\n<p><strong>2. @ConfigurationProperties<\/strong><\/p>\n\n\n\n<p>It is not only convenient but also important to encapsulate properties of feature toggles in an object that will be registered in the Spring application\u2019s container. For doing this, the developer needs to include the dependency\u00a0<em>spring-boot-configuration-processor:<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"127\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/aolWedIH_l5b1Fu0X-oQmpfxHrniKc9o-1024x127.png\" alt=\"\" class=\"wp-image-2910\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/aolWedIH_l5b1Fu0X-oQmpfxHrniKc9o-1024x127.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/aolWedIH_l5b1Fu0X-oQmpfxHrniKc9o-150x19.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/aolWedIH_l5b1Fu0X-oQmpfxHrniKc9o-300x37.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/aolWedIH_l5b1Fu0X-oQmpfxHrniKc9o-768x95.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/aolWedIH_l5b1Fu0X-oQmpfxHrniKc9o.png 1028w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> Now, it is time for class with field flags: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"196\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/6yWGLsKIwa7ODddcf7HZtgJYW_mzvUZP.png\" alt=\"\" class=\"wp-image-2911\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/6yWGLsKIwa7ODddcf7HZtgJYW_mzvUZP.png 1023w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/6yWGLsKIwa7ODddcf7HZtgJYW_mzvUZP-150x29.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/6yWGLsKIwa7ODddcf7HZtgJYW_mzvUZP-300x57.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/6yWGLsKIwa7ODddcf7HZtgJYW_mzvUZP-768x147.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<p>For Spring to gather object from the class\u00a0<em>FeatureFlags<\/em>\u00a0with properties from\u00a0<em>application.yml<\/em>, it is necessary to do the following: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"132\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/q0QMz52vHkwYoNuhaj3320SZ4ezWa0Im-1024x132.png\" alt=\"\" class=\"wp-image-2912\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/q0QMz52vHkwYoNuhaj3320SZ4ezWa0Im-1024x132.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/q0QMz52vHkwYoNuhaj3320SZ4ezWa0Im-150x19.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/q0QMz52vHkwYoNuhaj3320SZ4ezWa0Im-300x39.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/q0QMz52vHkwYoNuhaj3320SZ4ezWa0Im-768x99.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/q0QMz52vHkwYoNuhaj3320SZ4ezWa0Im.png 1027w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>So now it is possible to use the object from the class\u00a0<em>FeatureFlags<\/em>\u00a0as a bean through Spring dependency: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"156\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/UDtYYbgUMVrAhIOxn26E0dP41WVf2sPB-1024x156.png\" alt=\"\" class=\"wp-image-2913\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/UDtYYbgUMVrAhIOxn26E0dP41WVf2sPB-1024x156.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/UDtYYbgUMVrAhIOxn26E0dP41WVf2sPB-150x23.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/UDtYYbgUMVrAhIOxn26E0dP41WVf2sPB-300x46.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/UDtYYbgUMVrAhIOxn26E0dP41WVf2sPB-768x117.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/UDtYYbgUMVrAhIOxn26E0dP41WVf2sPB.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Feature Flags Adjustment in Runtime<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Configuration Server.<\/strong><\/h3>\n\n\n\n<p>Feature flags often need to be adjusted and modified during the run of the app. One way to do this is through the Configuration Server. Configuration Server is a separate Spring Boot application that provides HTTP resource-based API for the main app to request its configuration. A simple Configuration Server looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"199\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/BylRxJn0LDExipwr4Gma5EMKc74do83v-1024x199.png\" alt=\"\" class=\"wp-image-2914\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/BylRxJn0LDExipwr4Gma5EMKc74do83v.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/BylRxJn0LDExipwr4Gma5EMKc74do83v-150x29.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/BylRxJn0LDExipwr4Gma5EMKc74do83v-300x58.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/BylRxJn0LDExipwr4Gma5EMKc74do83v-768x149.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> It\u2019s necessary to add a dependency: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"133\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/afuoXGL3y4ps_PXtX2vfNBecBEvvqr3Q.png\" alt=\"\" class=\"wp-image-2915\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/afuoXGL3y4ps_PXtX2vfNBecBEvvqr3Q.png 1023w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/afuoXGL3y4ps_PXtX2vfNBecBEvvqr3Q-150x20.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/afuoXGL3y4ps_PXtX2vfNBecBEvvqr3Q-300x39.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/afuoXGL3y4ps_PXtX2vfNBecBEvvqr3Q-768x100.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<p>A feature flag information can be stored in a database. Let\u2019s consider the example of\u00a0<em>MySQL<\/em>\u00a0by creating a\u00a0<em>properties<\/em>\u00a0table with a structure like this: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"273\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/ylPGLqu9iZx6wg6QV7FqiTu0Ieaw_Jjg-1024x273.png\" alt=\"\" class=\"wp-image-2916\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/ylPGLqu9iZx6wg6QV7FqiTu0Ieaw_Jjg-1024x273.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/ylPGLqu9iZx6wg6QV7FqiTu0Ieaw_Jjg-150x40.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/ylPGLqu9iZx6wg6QV7FqiTu0Ieaw_Jjg-300x80.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/ylPGLqu9iZx6wg6QV7FqiTu0Ieaw_Jjg-768x205.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/ylPGLqu9iZx6wg6QV7FqiTu0Ieaw_Jjg.png 1027w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It is necessary to add dependencies to work with a database: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"131\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oHbrKTliss7k2p9peqgVBUx6H4XYj-T1-1024x131.png\" alt=\"\" class=\"wp-image-2917\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oHbrKTliss7k2p9peqgVBUx6H4XYj-T1-1024x131.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oHbrKTliss7k2p9peqgVBUx6H4XYj-T1-150x19.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oHbrKTliss7k2p9peqgVBUx6H4XYj-T1-300x38.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oHbrKTliss7k2p9peqgVBUx6H4XYj-T1-768x99.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/oHbrKTliss7k2p9peqgVBUx6H4XYj-T1.png 1029w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"127\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Ec_zvQTtyotkWX5CPVu3Vem_4qI3OSsH-1024x127.png\" alt=\"\" class=\"wp-image-2918\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Ec_zvQTtyotkWX5CPVu3Vem_4qI3OSsH.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Ec_zvQTtyotkWX5CPVu3Vem_4qI3OSsH-150x19.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Ec_zvQTtyotkWX5CPVu3Vem_4qI3OSsH-300x37.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Ec_zvQTtyotkWX5CPVu3Vem_4qI3OSsH-768x95.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Then, feature flags are added into the table: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"106\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/nsi0i7QC6mBsmeNK_uq3FK86FiN-FYy5-1024x106.png\" alt=\"\" class=\"wp-image-2919\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/nsi0i7QC6mBsmeNK_uq3FK86FiN-FYy5.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/nsi0i7QC6mBsmeNK_uq3FK86FiN-FYy5-150x16.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/nsi0i7QC6mBsmeNK_uq3FK86FiN-FYy5-300x31.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/nsi0i7QC6mBsmeNK_uq3FK86FiN-FYy5-768x80.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Configuration Server\u2019s\u00a0<em>application.yml<\/em>\u00a0looks like this: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"344\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/bwp3__u21ZVKbERYEvnQ5HpskNRVwkaq-1024x344.png\" alt=\"\" class=\"wp-image-2920\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/bwp3__u21ZVKbERYEvnQ5HpskNRVwkaq-1024x344.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/bwp3__u21ZVKbERYEvnQ5HpskNRVwkaq-150x50.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/bwp3__u21ZVKbERYEvnQ5HpskNRVwkaq-300x101.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/bwp3__u21ZVKbERYEvnQ5HpskNRVwkaq-768x258.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/bwp3__u21ZVKbERYEvnQ5HpskNRVwkaq.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Through HTTH, the main app will receive feature flags from the Configuration Server if the following dependency is added: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"135\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/5W4FdPUQKxTXusc5s2GUS8EYQsAa_mlo-1024x135.png\" alt=\"\" class=\"wp-image-2921\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/5W4FdPUQKxTXusc5s2GUS8EYQsAa_mlo-1024x135.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/5W4FdPUQKxTXusc5s2GUS8EYQsAa_mlo-150x20.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/5W4FdPUQKxTXusc5s2GUS8EYQsAa_mlo-300x39.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/5W4FdPUQKxTXusc5s2GUS8EYQsAa_mlo-768x101.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/5W4FdPUQKxTXusc5s2GUS8EYQsAa_mlo.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Also, it is needed to add the following\u00a0<em>bootstrap<\/em>\u00a0configuration: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"176\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/1JprG5W7Le-gI5gPgriDtsN2YK3L2_1t-1024x176.png\" alt=\"\" class=\"wp-image-2922\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/1JprG5W7Le-gI5gPgriDtsN2YK3L2_1t-1024x176.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/1JprG5W7Le-gI5gPgriDtsN2YK3L2_1t-150x26.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/1JprG5W7Le-gI5gPgriDtsN2YK3L2_1t-300x51.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/1JprG5W7Le-gI5gPgriDtsN2YK3L2_1t-768x132.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/1JprG5W7Le-gI5gPgriDtsN2YK3L2_1t.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now it is possible to store flags in a database and load them to the main app at the start.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Spring Actuator and @RefreshScope.<\/strong><\/h3>\n\n\n\n<p>Now, what if the app is already running and some feature needs to be activated? Spring Actuator will help. First, it is necessary to add a dependency:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"132\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/x8-5yFbsJNoO2p9Bmo0BtZkMAdUYXTYv-1024x132.png\" alt=\"\" class=\"wp-image-2923\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/x8-5yFbsJNoO2p9Bmo0BtZkMAdUYXTYv-1024x132.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/x8-5yFbsJNoO2p9Bmo0BtZkMAdUYXTYv-150x19.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/x8-5yFbsJNoO2p9Bmo0BtZkMAdUYXTYv-300x39.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/x8-5yFbsJNoO2p9Bmo0BtZkMAdUYXTYv-768x99.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/x8-5yFbsJNoO2p9Bmo0BtZkMAdUYXTYv.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Auto-configuration of the Actuator\u2019s refresh endpoint will be used via JMX, but it is possible to use it via HTTP: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"64\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LtyH7eLesGy9PqAOhoDE3AcmnOPDm40k-1024x64.png\" alt=\"\" class=\"wp-image-2924\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LtyH7eLesGy9PqAOhoDE3AcmnOPDm40k-1024x64.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LtyH7eLesGy9PqAOhoDE3AcmnOPDm40k-150x9.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LtyH7eLesGy9PqAOhoDE3AcmnOPDm40k-300x19.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LtyH7eLesGy9PqAOhoDE3AcmnOPDm40k-768x48.png 768w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LtyH7eLesGy9PqAOhoDE3AcmnOPDm40k.png 1027w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>For refreshing properties of flags,\u00a0<em>@RefreshScope<\/em>\u00a0annotation should be added: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"223\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Rvo1Q4fS9zRqkFC1VJy463uDIvEKs2mw-1024x223.png\" alt=\"\" class=\"wp-image-2925\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Rvo1Q4fS9zRqkFC1VJy463uDIvEKs2mw.png 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Rvo1Q4fS9zRqkFC1VJy463uDIvEKs2mw-150x33.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Rvo1Q4fS9zRqkFC1VJy463uDIvEKs2mw-300x65.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/Rvo1Q4fS9zRqkFC1VJy463uDIvEKs2mw-768x167.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now it is possible to summon new values of flags through POST&nbsp;<em>\/actuator\/refresh<\/em>.<\/p>\n\n\n\n<p>The diagram below presents the described architecture.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/RbUvg8gi7C9ANxko6AUwT_IKmElZbIPm-1024x723.jpg\" alt=\"\" class=\"wp-image-2926\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/RbUvg8gi7C9ANxko6AUwT_IKmElZbIPm-1024x723.jpg 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/RbUvg8gi7C9ANxko6AUwT_IKmElZbIPm-150x106.jpg 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/RbUvg8gi7C9ANxko6AUwT_IKmElZbIPm-300x212.jpg 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/RbUvg8gi7C9ANxko6AUwT_IKmElZbIPm-768x542.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>How will the implementation change? Beans are created when the app launches with the help of the annotation\u00a0<em>@ConditionalOnProperty<\/em>, and they won\u2019t change after the refresh. The problem can be solved with the help of\u00a0<em>@PostConstruct<\/em>, the same\u00a0<em>@RefreshScope<\/em>\u00a0annotation, and the Proxy pattern:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"776\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LKmlYrqWCBud3cfY72iV8pJBeE8Q902I.png\" alt=\"\" class=\"wp-image-2927\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LKmlYrqWCBud3cfY72iV8pJBeE8Q902I.png 1023w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LKmlYrqWCBud3cfY72iV8pJBeE8Q902I-150x114.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LKmlYrqWCBud3cfY72iV8pJBeE8Q902I-300x228.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/LKmlYrqWCBud3cfY72iV8pJBeE8Q902I-768x583.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Front-end.<\/strong><\/h3>\n\n\n\n<p>Frequently, new functions are not only about the back-end changes. Feature flags should be used for the front-end as well. To do this, it is enough to use an additional endpoint\u00a0<em>GET \/feature-flags:<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"269\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/w8R0UL6tIbttOZbgcDflu-qm24ppWJ0f.png\" alt=\"\" class=\"wp-image-2928\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/w8R0UL6tIbttOZbgcDflu-qm24ppWJ0f.png 1022w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/w8R0UL6tIbttOZbgcDflu-qm24ppWJ0f-150x39.png 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/w8R0UL6tIbttOZbgcDflu-qm24ppWJ0f-300x79.png 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/w8R0UL6tIbttOZbgcDflu-qm24ppWJ0f-768x202.png 768w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/figure>\n\n\n\n<p>Now you can see that the Spring framework has simple and flexible tools used to work with feature toggles. Web developers don\u2019t need to use any additional libraries since Standard Spring Boot features and other ready-to-use Spring projects (Spring Actuator, Spring Cloud Config Server, etc.) cover all their needs. <\/p>\n\n\n\n<p>Making new features visible to a limited number of users allows collecting feedback from the users in the early stages. It empowers the development team to make adjustments and changes before releasing a web application. If some new features are still too early to release, developers can turn them on just for themselves to try, test, and adjust. This helps ensure a flawless release.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/gids8Bis5O9SwXiQNMdRSIHnS5n0NM4w-1024x723.jpg\" alt=\"\" class=\"wp-image-2929\" srcset=\"https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/gids8Bis5O9SwXiQNMdRSIHnS5n0NM4w-1024x723.jpg 1024w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/gids8Bis5O9SwXiQNMdRSIHnS5n0NM4w-150x106.jpg 150w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/gids8Bis5O9SwXiQNMdRSIHnS5n0NM4w-300x212.jpg 300w, https:\/\/alternative-spaces.com\/blog\/wp-content\/uploads\/2020\/09\/gids8Bis5O9SwXiQNMdRSIHnS5n0NM4w-768x542.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The feature flag technique makes software development more stable, quick, and controllable, and helps resolve several major troubles in production release, thus reducing the development costs for the web application owner. Regular high-quality software feature releases are vital for a good user experience and holding the users\u2019 attention.&nbsp;<\/p>\n\n\n\n<p>If there is a project you are considering,\u00a0<a href=\"https:\/\/alternative-spaces.com\/contact-us\">our expert team<\/a>\u00a0can help bring your idea to life and ensure that it evolves through seamless feature releases.<\/p>\n\n\n\n<p>Content created by our partner, Onix-systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Feature flag (also known as feature toggle or feature switch) is a technique that allows separating feature release from deploying code during software development. That way, an application is under full control since developers can set who sees its features and when. This makes feature toggles integral to the continuous delivery approach which facilitates quick [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":2898,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/posts\/2897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/comments?post=2897"}],"version-history":[{"count":1,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/posts\/2897\/revisions"}],"predecessor-version":[{"id":2930,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/posts\/2897\/revisions\/2930"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/media\/2898"}],"wp:attachment":[{"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/media?parent=2897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/categories?post=2897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alternative-spaces.com\/blog\/wp-json\/wp\/v2\/tags?post=2897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}