Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Feature Toggle
Next
Download to read offline and view in fullscreen.

4

Share

Download to read offline

Feature toggling

Download to read offline

Feature toggling is a multi-purpose technique for easily turning features on and off. I will describe the concept, different types of feature toggles, some best practices, and give some examples of how Visma currently uses feature toggling.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Feature toggling

  1. 1. Feature toggling(feature toggles, feature flags, feature switches, feature bits, feature flippers, …) T. Alexander Lystad Chief QA Architect, VES Dev
  2. 2. Definition of a feature toggle Mechanism for easily enabling or disabling certain system behavior
  3. 3. All developers have used feature toggles var r = someOldFunction(); //var r = someNewFunction();
  4. 4. Toggle Points var r; var newFeatureIsEnabled = false; if (newFeatureIsEnabled) { r = someNewFunction(); } else { r = someOldFunction(); }
  5. 5. Toggle Points var r; var newFeatureIsEnabled = false; if (newFeatureIsEnabled) { r = someNewFunction(); } else { r = someOldFunction(); } ● Configuration (on/off) stored in the application code ● Can only be toggled (enabled/disabled) during development
  6. 6. Toggle Configuration ● Properties ○ State ■ On ■ Off ○ Time ■ From ■ To ○ User/Organization/Customer/Company ■ Role ■ Percentage ■ Location ■ Id ■ … ○ ...
  7. 7. Toggle Configuration ● Storage ○ (Application code) ○ Configuration file ○ Application database ○ Separate service ● Toggling ○ (At development time) ○ (At build time) ○ (At deployment time) ○ (At start-up time) ○ At run-time
  8. 8. Toggle Context ● Conditions at evaluation time ○ Current time ○ Current request/task ○ Current user
  9. 9. UI Examples
  10. 10. VIGO
  11. 11. Visma.net Payroll
  12. 12. eAccounting
  13. 13. eAccounting
  14. 14. 5 use cases
  15. 15. Separating release and deployment ● Deploy software/builds/versions ● Release features
  16. 16. Use case #1 Continuous Integration and Continuous Delivery of incomplete features
  17. 17. Continuous Integration Code should not live outside of the main branch (for long)
  18. 18. Continuous Integration Code should not live outside of the main branch (for long) Continuous Delivery Code should not live outside of Production (for long)
  19. 19. Continuous Integration Code should not live outside of the main branch (for long) e.g. max 1 day Continuous Delivery Code should not live outside of Production (for long) e.g. max 3 days
  20. 20. Some features will take longer to implement ● Local copy ● Feature branch
  21. 21. Some features will take longer to implement ● Local copy ● Feature branch ● Feature toggle
  22. 22. Some features will take longer to implement ● Local copy ● Feature branch ● Feature toggle ● Incrementally on main branch (easier for new functionality)
  23. 23. Some features will take longer to implement ● Local copy ● Feature branch ● Feature toggle ● Incrementally on main branch (easier for new functionality) ● Branch by abstraction (technique for larger-scale changes) ● Branch by abstraction + feature toggle
  24. 24. Branch by Abstraction
  25. 25. Branch by Abstraction
  26. 26. Branch by Abstraction
  27. 27. Branch by Abstraction
  28. 28. But, wait ● What if we want to switch to the new implementation for all clients at the same time?
  29. 29. Feature Toggle
  30. 30. Use case #2 Gradual release: Internal testing, canary releasing and dark launching
  31. 31. Internal testing in Production ● In order to achieve a fully automated delivery pipeline, manual QA must be moved outside of the delivery pipeline ○ Before pipeline ■ Cross-functional discussion ■ Code review ■ Show me session ○ After pipeline ■ Testing in Production = Enabling features in Production for internal users
  32. 32. Canary Releasing ● of an application (Canary Deployment) ○ Subset of infrastructure as canaries ○ Incremental upgrade ● of a feature (Canary Release) ○ Subset of users as canaries ○ Incremental toggle ● Monitoring
  33. 33. Dark Launching ● Large scale real-life testing ● Enabling and exercising a feature in Production without showing it the user ● To test with realistic data and load ● Different from internal testing ● Different from canary releasing ● Used for rolling out Facebook chat in 2008 ● Does not require feature toggles, but is often used with canary release which does
  34. 34. Use case #3 Timed release
  35. 35. ● To coordinate with marketing material, events, etc ● To coordinate with laws and regulations ● To release a feature simultaneously across services Examples
  36. 36. HRM
  37. 37. HRM
  38. 38. Use case #4 A/B testing and other forms of experimentation
  39. 39. A/B testing A B
  40. 40. A/B testing A B
  41. 41. A/B testing is a science in its own right ● There are specialized A/B testing tools out there ● Traditional A/B testing is one of multiple possible ways to approach the multi- armed bandit problem
  42. 42. Use case #5 Circuit breakers
  43. 43. Dialing it down or turning it off ● High risk features ○ e.g. functionality, performance
  44. 44. Best practices ● Feature Toggles have a cost ○ More complex code, more testing, maintenance overhead ● Feature Toggles should be regarded as an investment, use when ROI>0 ● Implement carefully to minimize complexity and technical debt ● Have a good overview over which feature toggles exist, for what purpose, what state they are in and why ● Have a process for removing unnecessary feature toggles ○ Most of them should be temporary
  45. 45. LaunchDarkly Feature toggling as a service
  46. 46. Custom implementation? Feature toggle library? External service?
  47. 47. featureflags.io
  • HishamuddinMohamad

    Jul. 2, 2018
  • AparajitaBhatnagar

    Mar. 12, 2018
  • WanatchapongManotham

    Sep. 8, 2017
  • powerirs

    Jan. 8, 2017

Feature toggling is a multi-purpose technique for easily turning features on and off. I will describe the concept, different types of feature toggles, some best practices, and give some examples of how Visma currently uses feature toggling.

Views

Total views

1,922

On Slideshare

0

From embeds

0

Number of embeds

154

Actions

Downloads

53

Shares

0

Comments

0

Likes

4

×