Feature Toggles On Steroids
Feature Toggles On Steroids
2 / 99
3 / 99
Feature Branches(aka Branch Based Development)
Quelle: http://geekswithblogs.net/Optikal/archive/2013/02/10/152069.aspx
4 / 99
Problem 1: ...
Quelle: http://martinfowler.com/bliki/FeatureBranch.html
5 / 99
Problem 1: ...
Quelle: http://martinfowler.com/bliki/FeatureBranch.html
6 / 99
Problem 1: ...
Quelle: http://martinfowler.com/bliki/FeatureBranch.html
7 / 99
Problem 1: ...
Quelle: http://martinfowler.com/bliki/FeatureBranch.html
8 / 99
Problem 1: Merge Pain
Quelle: http://martinfowler.com/bliki/FeatureBranch.html
9 / 99
Problem 2: Communication Islands
„Branches create distance between developers and we don’t want that“
Frank Compagner
Quelle: http://paulhammant.com/2014/09/24/a-functional-branch-by-abstraction-case-study/
10 / 99
Problem 3: No Continuous Integration
Quelle: http://de.slideshare.net/eugenmartynov/flow-23558345
11 / 99
Branch Based Development
Quelle: http://geekswithblogs.net/Optikal/archive/2013/02/10/152069.aspx
12 / 99
Trunk Based Development
No Merge Pain
No Communication Islands
Continuous Integration
13 / 99
Trunk Based Development
No Merge Pain
No Communication Islands
Continuous Integration
Refactoring Friendly
14 / 99
Trunk Based Development
There are branches.
15 / 99
Trunk Based Development
There are branches.
But there are no feature branches!
16 / 99
Feature Branches ↔ Trunk Based Dev.
Merge Conflict Resolutioncosts time is error-prone
Communication Islands
No Continuous Integration
No Merge Pain
No Communication Islands
Continuous Integration
Refactoring Friendly
17 / 99
Feature Branches ↔ Trunk Based Dev.
Merge Conflict Resolutioncosts time is error-prone
Communication Islands
No Continuous Integration
Stable trunk
No Merge Pain
No Communication Islands
Continuous Integration
Refactoring Friendly
18 / 99
Feature Branches ↔ Trunk Based Dev.
Merge Conflict Resolutioncosts time is error-prone
Communication Islands
No Continuous Integration
Stable trunk
No Merge Pain
No Communication Islands
Continuous Integration
Refactoring Friendly
Unstable trunk
19 / 99Quelle: http://www.infoq.com/presentations/Development-at-Google
20 / 99
Do you have pre-commit-verification?
21 / 99Quelle: http://paulhammant.com/2013/12/04/what_is_your_branching_model/
Use short lived issue branchesor personal branches instead.
22 / 99
How do you prevent, that incomplete features are released?
23 / 99
Feature Toggles
aka Feature Bits
aka Feature Flags
aka Feature Switches
aka Feature Flippers
aka Conditional Features
aka Latent Code Pattern
24 / 99
Feature Toggles
Quelle: http://martinfowler.com/bliki/FeatureToggle.html
25 / 99
IFEATURE TOGGLES
26 / 99
Why Feature Toggles?
Hide unfinished features from users
27 / 99
Why Feature Toggles?
Hide unfinished features from users
“Stable trunk” for visible functionality
28 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
29 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
30 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
31 / 99
Granularity
32 / 99
Granularity
● per environment (local, staging, live)● per server● per customer/mandator
- inherited if you have a hierarchy● per user
- a certain percentage of users● per country● per session
- a certain percentage of sessions● ...
33 / 99
Granularity
● per environment (local, staging, live)● per server● per customer/mandator
- inherited if you have a hierarchy● per user
- a certain percentage of users● per country● per session
- a certain percentage of sessions● ...
34 / 99
Granularity (example #1)
35 / 99
Granularity (example #2)
Quelle: http://www.togglz.org/documentation/activation-strategies.html
36 / 99
Granularity (example #3)
Quelle: http://abhishek-tiwari.com/post/decoupling-deployment-and-release-feature-toggles
37 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
38 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
Better Software Architecture
39 / 99
Feature Toggle = Feature Toggle|
40 / 99
Feature Toggle = Feature Toggle|
long lived,payed for by customer
41 / 99
Feature Toggle = Feature Toggle|
long lived,payed for by customer
Business
Toggle
42 / 99
Feature Toggle = Feature Toggle|
long lived,payed for by customer
short lived,payed for by your company
Business
Toggle
43 / 99
Feature Toggle = Feature Toggle|
long lived,payed for by customer
short lived,payed for by your company
Business
ToggleBusiness
Toggle
ReleaseToggle
44 / 99
Release Toggle = Release Toggle|
45 / 99
Release Toggle = Release Toggle|
hides a new feature
46 / 99
Release Toggle = Release Toggle|
hides a new feature
e.g. new functionality (new menu point, new dialog, ...)
47 / 99
Release Toggle = Release Toggle|
hides a new feature
e.g. new functionality (new menu point, new dialog, ...)
hides a new implementation
48 / 99
Release Toggle = Release Toggle|
hides a new feature
e.g. new functionality (new menu point, new dialog, ...)
hides a new implementatione.g. - new design - new backend technology (PHP → Java or Hibernate → MongoDB) - performance optimization (added caching or better algorithm) - ...
49 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
50 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
51 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
52 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
53 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
54 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
55 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
56 / 99
Branch By Abstraction
Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html
You wanna keep this
57 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
Better Software Architecture
58 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
Better Software Architecture
Testing in Live Environment with Live Data
59 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
Better Software Architecture
Testing in Live Environment with Live Data
60 / 99
Release Toggle = Release Toggle|
hides a new feature hides a new implementation
61 / 99
Release Toggle = Release Toggle|
hides a new feature hides a new implementation
Dark Launching Pattern
62 / 99
Dark Launching (example)
63 / 99
Release Toggle = Release Toggle|
hides a new feature hides a new implementation
Dark Launching Pattern
Beta-TestingA/B-Testing
64 / 99
Release Toggle = Release Toggle|
hides a new feature hides a new implementation
Dark Launching Pattern
Beta-TestingA/B-Testing
Verify Branch By Abstraction Pattern
65 / 99
Branch By Abstraction
Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/
66 / 99
Branch By Abstraction
Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/
67 / 99
Verify Branch By Abstraction
Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/
68 / 99
Verify Branch By Abstraction
Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/
● asynchronously(i.e. in the background, invisible for users)
● check for correctness● check for performance
69 / 99
Implementation: 2 Feature Toggles
Use new implementation?
Verify new implementation?
70 / 99
Implementation: 2 Feature Toggles
71 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
72 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code
73 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code
Use old code and
asynchronouslyverify new code
74 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code and
asynchronouslyverify new code
This costs!
Use old code
75 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code and
asynchronouslyverify new code
2x load?
Use old code
76 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code and
asynchronouslyverify new code
2x load?
Can you handle 100x load?
Use old code
77 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code and
asynchronouslyverify new code
Start small
Use old code
78 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code and
asynchronouslyverify new code
Restrictresourcesused byverifyUse old code
79 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use old code and
asynchronouslyverify new code
Use new code
Use old code
80 / 99
Implementation: 2 Feature TogglesU
se n
ew im
ple
men
tatio
n?
Verify new implementation?
Use new code
Use new code and
asynchronouslyverify old code
Use old code and
asynchronouslyverify new code
Use old code
81 / 99
Verify Pattern (example)
82 / 99
Verify Pattern (example)
83 / 99
Verify Pattern (example)
84 / 99
Verify Pattern (example)
85 / 99
Verify Pattern (example)
86 / 99
Why Feature Toggles?
Hide unfinished features from users
Separate Deployment and Release
Fearless Deployment
No Big Bang Releases
Better Software Architecture
Testing in Live Environment with Live Data
87 / 99
Some Questions Remain
● What should the system doif an asynchronous verify fails?
● Which library should you usefor Feature Toggles?(Should you use a library at all?)
● When do you deleteold Feature Toggles?
● How do you do testing withFeature Toggles?
● ...
88 / 99
What should the system doif an asynchronous verify fails?
Logging Metriken
89 / 99
What should the system doif an asynchronous verify fails?
Logging Metriken
90 / 99
Which library should you usefor Feature Toggles?
91 / 99
But here is a tip ...
Don't use Strings, Use an Enum.
Prevents typing errors
Code completion
You can easily add documentation
Makes it easy to remove a Feature Toggle
92 / 99
When do you deleteold Feature Toggles?
When you are confident
93 / 99
When do you deleteold Feature Toggles?
When you are confident
(probably serveral weeks after you activated the
Feature Toggle globally)
94 / 99
Testing with Feature Toggles –Combinatorial Explosion?
95 / 99
Testing with Feature Toggles(example #1)
96 / 99
Testing with Feature Toggles(example #1)
97 / 99
Testing with Feature Toggles(example #2)
Quelle: https://gist.github.com/MichaelTamm/d5a5a67460d7a2db08a4
98 / 99
Testing with Feature Toggles(example #3)
99 / 99
Main Takeaways
● Use short lived issue or personal branches ● Use fine-grained Feature Toggles● Verify new implementations
– asynchronously in the background on live systems
– in the background, but blocking on test systems
● Choose names for Feature Toggles with care● Use Enums for Feature Toggles