Learning Library

← Back to Library

Feature Flags: Controlled Production Rollouts

Key Points

  • Feature flags (or toggles) let you turn code‑driven capabilities on or off without redeploying, enabling safe production testing and instant rollbacks.
  • They support user segmentation, so you can expose a feature—like an “open banner” for a new ice‑cream shop—only to specific groups such as nearby customers or internal testers.
  • Managing flags through a dedicated feature‑flag service provides a centralized dashboard, audit trails, usage analytics, and eliminates the need to modify JSON or config files for each change.
  • Deploying a feature in a “dark launch” state lets the code run in production while remaining hidden until you selectively enable it for chosen user segments.

Full Transcript

# Feature Flags: Controlled Production Rollouts **Source:** [https://www.youtube.com/watch?v=AJa2B-twtG4](https://www.youtube.com/watch?v=AJa2B-twtG4) **Duration:** 00:06:39 ## Summary - Feature flags (or toggles) let you turn code‑driven capabilities on or off without redeploying, enabling safe production testing and instant rollbacks. - They support user segmentation, so you can expose a feature—like an “open banner” for a new ice‑cream shop—only to specific groups such as nearby customers or internal testers. - Managing flags through a dedicated feature‑flag service provides a centralized dashboard, audit trails, usage analytics, and eliminates the need to modify JSON or config files for each change. - Deploying a feature in a “dark launch” state lets the code run in production while remaining hidden until you selectively enable it for chosen user segments. ## Sections - [00:00:00](https://www.youtube.com/watch?v=AJa2B-twtG4&t=0s) **Feature Flags for Safe Releases** - Dilan Orrino explains how feature flags let you toggle functionality for targeted user groups, test changes directly in production, and instantly roll them back without redeploying, especially via a dedicated feature‑flag service. - [00:03:11](https://www.youtube.com/watch?v=AJa2B-twtG4&t=191s) **Dark Launch with Segmented Feature Flags** - The speaker explains using a dark launch and defined user segments to test a new production feature on internal employees before gradually exposing it to targeted customers, all without redeploying the code. ## Full Transcript
0:00What if you could release a feature to different  groups of users without deployment? Is there a way 0:05to effectively test features in production, and  immediately roll them back if needed? Hi, my name 0:11is Dilan Orrino with IBM Cloud. I'll be answering  those questions by discussing feature flags, 0:16or sometimes referred to as feature toggle,  or switches. Feature flags are conditions 0:23that encompass feature code that allow you to  flip them on and off at will. Okay, let's use 0:29an example. Let's say we've got an ice cream shop  franchise that's looking to expand to a new city 0:37and we've got a banner that we want to display  on our website. We'll call this open banner. 0:50We only want to display this banner to users that  are nearby our new ice cream shop we can do this 1:00by using feature flags. There's a  couple benefits to using feature flags. 1:07Number one is we can actually turn  these on or off without deployment. 1:16Number two is we can actually  test directly in production. 1:25And number three we can segment our  users based on different attributes. 1:36Okay, there's a couple ways you can do this  one way is by using properties in JSON files 1:43or config maps. There's a better way however  by using a feature flag service. There's a 1:49couple benefits to using a feature flag service.  Number one is you can have essentially managed 1:59place 2:03for your features, or excuse me your feature  flags. Number two is you can turn these on and off 2:11without modifying 2:14your properties in your future, in your  apps or web pages. And number three is you 2:19get audit and usage data. It's harder to get  the audit and usage data by using JSON files. 2:28Okay, so now let's go back to our  example we've got our open banner 2:33feature and now let's wrap it  with some feature flag code. 2:36And so here's an example, kind of pseudo  code, that you can use if store open 2:45is enabled. 2:54Then we're going to show open banner 3:05so this pseudocode represents our feature code  and the flag that potentially could encompass it. 3:13Now let's actually put this in production  and make it show showcase to some users. So 3:24now that we've got our feature in production  it's not usable to any users right now 3:29this is an idea typically displayed with feature  flags called dark launch. Dark launch is when a 3:34feature is in production but not visible to any  or all users or any or some users, excuse me. 3:43Now we want to introduce the idea of segments. 3:48So we've already said that we only want  a certain number of people to view this, 3:51people who are nearby our new shop. This will be  our segment A, and a segment is simply users or 3:58groups of users that have attributes tied to them.  So this first one might have current location, 4:07and zip code. 4:11Attributes, this allows users who  are either currently in the location 4:15or have already stipulated that they live nearby  to view this feature, but before we do that 4:22we want to test the feature out on our  own employees. So we would have segment B 4:29of our testers because we want them to be our  employees the attribute might be email ID. 4:38Now we can effectively test our feature  in production by flipping this toggle on. 4:47So now this feature is on for our testers,  and say maybe something went wrong so we're 4:51actually going to flip it off fix it, and  then we'll turn it back on for segment B 4:55once we're satisfied that everything is  working well. Then we can flip this on 4:59for our segment A now all this is done without  a deployment because our feature is already in 5:05production. All we're doing is making it  visible or not visible to certain users 5:11once it is in production. We can actually  add a little bit of automation to this 5:16with our testers, we did it manually, we flipped  it on and off manually, but with feature flags we 5:22can actually add a time element. So let's say we  only want this to be viewable for three weeks, two 5:27weeks before grand opening, one week after grand  opening of our new shop. This will be flipped on 5:32and then automatically turned off or not visible  for this segment of users after three weeks. 5:38Okay, so now we're getting really good at using  feature flags so our feature flags are potentially 5:43starting to stack up we might have a couple apps  and a couple websites with a couple different 5:48types of features that are flagged. So we've got  maybe app one here, app two, and say a web page. 6:03With a feature flagging service we can actually  group these in collections so that we're a little 6:07bit more organized with which feature flags are  tied to, which apps are web pages. So now today 6:14we've learned about returning feature flags on  and off without deployment testing directly in 6:20production, and then segmenting those features  based on the user attributes. Thank you for 6:24watching. If you have questions, please drop us  a line below. If you want to see more videos like 6:28this in the future, please like and subscribe.  And don't forget, you can grow your skills and 6:33earn badges with IBM CloudLabs, which are free  browser-based interactive kubernetes labs.