How to Safeguard Deployment Strategies Using Feature Flags

Boemo Mmopelwa
5 min readMar 27, 2024

--

Deployment strategies do a great job of providing a swift path for releasing and rolling back applications whenever needed. But executing these strategies is hard when the right tools and platforms are not implemented. One of the solutions that help in executing deployment strategies is feature flag platforms. Feature flag platforms give you metrics on how the new application version performs. This helps you to know whether to roll back the latest application or release the application to every user.

In this article, you will learn what deployment strategies are in detail. In addition, you will learn how feature flag platforms help you implement and facilitate different types of deployment strategies.

What are Deployment Strategies?

A deployment strategy is a procedure that details how the application will be staged and released to the users. These strategies are needed to ensure applications are deployed safely without any downtime or data loss. Deployment strategies can be used on all types of platforms or languages.

Deployment strategies offer different ways to deploy the app without downtime. Some create different environments for old and new applications, while others select a few users to access the new application before rolling it out to every user.

Deployment strategies are important because they guide you on how to deploy your application to reduce the risk of release failure. Deployment strategies also break down big releases into small releases that can be pushed to production easily.

Types of Deployment Strategies

Below are different deployment strategies that take various approaches to when and how deployments should be executed.

1. Canary Deployment Strategy

This strategy selects a set of users that will use and test the new application. The users are selected using geolocation and user behavior. The canary deployment strategy focuses on monitoring and analyzing the performance of the newly deployed application version to vet whether it is ready to be rolled out to the rest of the user base.

If the new application does not perform well it will be rolled back and if it performs well it will be deployed to more users. This strategy uses a progressive approach when it comes to deploying applications. The more the application performs well the more it is deployed to many users. This strategy is good when you are testing and rolling out a new specific feature.

The canary deployment strategy has a variation called the dark deployment strategy. The difference is that the dark deployment strategy uses cookies or any other fetched information about users to determine which group of users get the features first.

2. Blue-green Deployment Strategy

This deployment strategy creates two different deployment environments. One environment is used for thoroughly staging and releasing the new application version. Most of the time, this environment is called the green environment. The second environment is called the blue environment and it is used for hosting the live application and receives all traffic.

After the new application has been thoroughly tested and passed all checks, the green environments gradually start to receive traffic. The green environment can receive traffic all at once or the traffic routing process is sequential. The green environment will then become the production and live environment.

If the new application in the green environment fails, traffic will be re-routed to the blue environment which has the old and stable application.

3. Rolling Deployment Strategy

The rolling deployment strategy avoids downtime by updating the application instances in a phased manner. For example, if you are using Kubernetes deployments, this strategy will replace one pod at a time until all pods have been updated and are in a good state.

4. Recreate Deployment Strategy

The recreate deployment strategy is used when the application needs crucial solutions and urgent updates. Instead of slowly replacing application instances, the entire application services face downtime until the application has been updated. This strategy is used when the application has severe security vulnerabilities that puts the application in serious danger.

How to Safeguard Deployment Strategies Using Feature Flags

Feature flag platforms offer many solutions that help you integrate any deployment strategy into your pipelines. For example, Unleash lets you release a software version to a specific set of users. This approach sets up and initiates the canary deployment strategy. Below are solutions offered by the Unleash platform that boost your deployment strategy:

Canary Releases

When implementing canary releases Unleash makes it easy for you to target different sets of users using IPs and Hostnames. You can also get more certain using the UserID to select a particular user to roll out a feature to. Since Unleash is a feature flag management platform, it breaks down a big release into small easy-to-deploy features. This makes it easy to gradually roll out features. You can also segment users using tentantID, infrastructure, or geo-location.

Unleash is available across many languages and frameworks of your choice. Whatever framework application you want to deploy, Unleash provides the tools and SDK needed to implement the Canary release. Unleash supports the following frameworks and languages:

Server-Side

  • Go
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby

Client-Side

  • Android
  • Next.js
  • OS
  • JavaScript
  • React
  • Vue

A/B Testing and Experimentation

Unleash gives you a feature toggle evaluation that helps you spot performance bottlenecks. Unleash toggle impression data contains data on when the toggle was switched on and by whom. You can analyze the impression data in analytical tools such as Mixpanel and Google Analytics. Every toggle has the collect impression feature. You can switch it off if you don’t wish to collect any data. As you release the features Unleash will be monitoring the performance of the features on different types of toggles such as the experiment toggle which enables A/B testing and the permission toggle which changes features accessed by some users.

For more experimentation, Unleash uses feature toggle variants that fine-grain segmentation of users. The variant contains the following values:

  1. The name of the variant
  2. The Weight value which determines what percentage of users can receive traffic and be exposed to the new feature.
  3. The Payload adds more parameters to the toggle.
  4. The override specifies users who will always get the feature regardless.

Rollbacks and Kill Switches

Kill switch toggles are the utmost paramount feature needed by deployment strategies. Kill switches make the deployment rollback easy and swift by enabling you to switch off a particular feature if it is giving unexpected poor results. Kill switches help you switch off traffic to the live environment when using the blue-green deployment strategy. Kill switches also make it easy to switch off test features in case the specifically selected user base does not like the new feature when using the canary deployment strategy.

Conclusion

Deploying applications without following a deployment strategy creates many chances for release failure and downtime. Also, not using feature flag platforms to facilitate deployments hinders you from getting the full effectiveness of deployment strategies. Adopting deployment strategies and feature flags not only helps in mitigating release failure but also helps in delivering applications faster to the market and gaining customer trust through well-tested new features.

--

--

Boemo Mmopelwa
Boemo Mmopelwa

Written by Boemo Mmopelwa

Android developer| Tech Enthusiast|Innovative thinking is my passion | Learn and experience more to discover more

Responses (1)