45
Feature Flag Roll Out & Roll Back without Deployment

Feature Flag: Roll Out & Roll Back without Deployment

Embed Size (px)

Citation preview

Page 1: Feature Flag: Roll Out & Roll Back without Deployment

Feature FlagRoll Out & Roll Back without Deployment

Page 2: Feature Flag: Roll Out & Roll Back without Deployment

Feature Flag?New Feature On/Off

Page 3: Feature Flag: Roll Out & Roll Back without Deployment

Index

1. Problems before Feature Flag

2. Benefits

3. Weak Points

4. Libraries

Page 4: Feature Flag: Roll Out & Roll Back without Deployment

Problems before Feature Flag

Deployment == Roll Out

Page 5: Feature Flag: Roll Out & Roll Back without Deployment

Deployment

before Feature Flag

Page 6: Feature Flag: Roll Out & Roll Back without Deployment

Problem 0.No Test in Production

Page 7: Feature Flag: Roll Out & Roll Back without Deployment

Test ENV != Prod ENV

Page 8: Feature Flag: Roll Out & Roll Back without Deployment

Problem 1.Unclear Delivery

Time

Page 9: Feature Flag: Roll Out & Roll Back without Deployment

From Click To Roll Out: Maybe.. 30 minutes

Page 10: Feature Flag: Roll Out & Roll Back without Deployment

Problem 2.No Way to Dog

Fooding

Page 11: Feature Flag: Roll Out & Roll Back without Deployment

QA => All Users

Page 12: Feature Flag: Roll Out & Roll Back without Deployment

RollBack

before Feature Flag

Page 13: Feature Flag: Roll Out & Roll Back without Deployment

Problem 3.Slow Delivery

Page 14: Feature Flag: Roll Out & Roll Back without Deployment

From Click To Roll Out: Maybe.. 30 minutes

Page 15: Feature Flag: Roll Out & Roll Back without Deployment

Solution.New Feature On/Off

to Some Users

Page 16: Feature Flag: Roll Out & Roll Back without Deployment

One Click UI

Page 17: Feature Flag: Roll Out & Roll Back without Deployment

Code Level

if FeatureFlag.active?('fetureFoo', user) c = a/belse c = b == 0 ? 0 : a/bend

Page 18: Feature Flag: Roll Out & Roll Back without Deployment

Feature Flag Service

• Create if new flag is detected.• List flags.• Update a flag.• Delete too old flags.

Page 19: Feature Flag: Roll Out & Roll Back without Deployment

Infrastructure

Page 20: Feature Flag: Roll Out & Roll Back without Deployment

After Feature Flag

Page 21: Feature Flag: Roll Out & Roll Back without Deployment

Deployment

after Feature Flag

Page 22: Feature Flag: Roll Out & Roll Back without Deployment

Benefit 0.Test in Production

Page 23: Feature Flag: Roll Out & Roll Back without Deployment

Benefit 1.Clear & Fast Delivery

Time

Page 24: Feature Flag: Roll Out & Roll Back without Deployment

One Click & Real Time Roll Out

Page 25: Feature Flag: Roll Out & Roll Back without Deployment

Benefit 2.Easy Dog Fooding

Page 26: Feature Flag: Roll Out & Roll Back without Deployment

QA => Internal User => All

Page 27: Feature Flag: Roll Out & Roll Back without Deployment

Rollback

After Feature Flag

Page 28: Feature Flag: Roll Out & Roll Back without Deployment

Benefit 3.Fast Roll Back

Page 29: Feature Flag: Roll Out & Roll Back without Deployment

One Click & Real Time Roll Back

Page 30: Feature Flag: Roll Out & Roll Back without Deployment

Unexpected Benefit 4.

Simple A/B Test

Page 31: Feature Flag: Roll Out & Roll Back without Deployment

Weak Points

• Uncooperative Members• Too Big Changes to Use Feature Flag• Obsoleted Feature Flags are Debts• Dependency on Each Feature Flags

Page 32: Feature Flag: Roll Out & Roll Back without Deployment

No feature flag can be better

• Brand New API• Clear & Tiny Changes• Fixing a bug that makes something

worthless

Page 33: Feature Flag: Roll Out & Roll Back without Deployment

Weak Point 0.Uncooperative

Members

Page 34: Feature Flag: Roll Out & Roll Back without Deployment

Solution 0.Code Review!

No Flag No Merge

Page 35: Feature Flag: Roll Out & Roll Back without Deployment

Weak Point 1.Too Big Changes

to use Feature Flag

Page 36: Feature Flag: Roll Out & Roll Back without Deployment

Solution 1.Apply to End Point

Page 37: Feature Flag: Roll Out & Roll Back without Deployment

Solution 1-0. in Method

if FeatureFlag.active?('fetureFoo', user) c = foo(1, 2)else c = deprecated_foo(1, 2)end

def foo(a,b) ... ...end

def deprecated_foo(a,b) ... ...end

Page 38: Feature Flag: Roll Out & Roll Back without Deployment

Solution 1-0. in Classif FeatureFlag.active?('fetureFoo', user) c = Foo.new(1, 2)else c = DeprecatedFoo.new(1, 2)end

class Foo(a,b) ... ...end

class DeprecatedFoo(a,b) ... ...end

Page 39: Feature Flag: Roll Out & Roll Back without Deployment

Solution 1-0. in HTML# Javascript<option ng-show=“FeatureFlag.is_active(‘fetureFoo', user)" value="foo1"/><option ng-hide=“FeatureFlag.is_active('fetureFoo', user)" value="foo2"/>

# Server Rendering<% if FeatureFlag.active?('fetureFoo', user) %> <option value="foo1"/><% else %> <option value="foo2"/><% end %>

Page 40: Feature Flag: Roll Out & Roll Back without Deployment

Weak Point 2.Obsoleted Feature Flags are

Debts

Page 41: Feature Flag: Roll Out & Roll Back without Deployment

Solution 2.Clean Up in The

Sprint

Page 42: Feature Flag: Roll Out & Roll Back without Deployment

Weak Point 3.Dependency on Each

Feature FlagFeature Flag in Feature Flag in Feature Flag in …

Page 43: Feature Flag: Roll Out & Roll Back without Deployment

Libraries

• rollout for Ruby• Gutter for Python• Togglez for java

Page 44: Feature Flag: Roll Out & Roll Back without Deployment

Reference• https://martinfowler.com/articles/feature-

toggles.html• https://martinfowler.com/bliki/

FeatureToggle.html• https://msdn.microsoft.com/en-us/

magazine/dn683796• http://apptimize.com/feature-flags-launch/

Page 45: Feature Flag: Roll Out & Roll Back without Deployment

Q & A