Feature Toggles On Steroids

99
Feature Toggles On Steroids

Transcript of Feature Toggles On Steroids

Page 1: Feature Toggles On Steroids

Feature Toggles On Steroids

Page 2: Feature Toggles On Steroids

2 / 99

Page 3: Feature Toggles On Steroids

3 / 99

Feature Branches(aka Branch Based Development)

Quelle: http://geekswithblogs.net/Optikal/archive/2013/02/10/152069.aspx

Page 4: Feature Toggles On Steroids

4 / 99

Problem 1: ...

Quelle: http://martinfowler.com/bliki/FeatureBranch.html

Page 5: Feature Toggles On Steroids

5 / 99

Problem 1: ...

Quelle: http://martinfowler.com/bliki/FeatureBranch.html

Page 6: Feature Toggles On Steroids

6 / 99

Problem 1: ...

Quelle: http://martinfowler.com/bliki/FeatureBranch.html

Page 7: Feature Toggles On Steroids

7 / 99

Problem 1: ...

Quelle: http://martinfowler.com/bliki/FeatureBranch.html

Page 8: Feature Toggles On Steroids

8 / 99

Problem 1: Merge Pain

Quelle: http://martinfowler.com/bliki/FeatureBranch.html

Page 9: Feature Toggles On Steroids

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/

Page 10: Feature Toggles On Steroids

10 / 99

Problem 3: No Continuous Integration

Quelle: http://de.slideshare.net/eugenmartynov/flow-23558345

Page 11: Feature Toggles On Steroids

11 / 99

Branch Based Development

Quelle: http://geekswithblogs.net/Optikal/archive/2013/02/10/152069.aspx

Page 12: Feature Toggles On Steroids

12 / 99

Trunk Based Development

No Merge Pain

No Communication Islands

Continuous Integration

Page 13: Feature Toggles On Steroids

13 / 99

Trunk Based Development

No Merge Pain

No Communication Islands

Continuous Integration

Refactoring Friendly

Page 14: Feature Toggles On Steroids

14 / 99

Trunk Based Development

There are branches.

Page 15: Feature Toggles On Steroids

15 / 99

Trunk Based Development

There are branches.

But there are no feature branches!

Page 16: Feature Toggles On Steroids

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

Page 17: Feature Toggles On Steroids

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

Page 18: Feature Toggles On Steroids

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

Page 19: Feature Toggles On Steroids

19 / 99Quelle: http://www.infoq.com/presentations/Development-at-Google

Page 20: Feature Toggles On Steroids

20 / 99

Do you have pre-commit-verification?

Page 21: Feature Toggles On Steroids

21 / 99Quelle: http://paulhammant.com/2013/12/04/what_is_your_branching_model/

Use short lived issue branchesor personal branches instead.

Page 22: Feature Toggles On Steroids

22 / 99

How do you prevent, that incomplete features are released?

Page 24: Feature Toggles On Steroids

24 / 99

Feature Toggles

Quelle: http://martinfowler.com/bliki/FeatureToggle.html

Page 25: Feature Toggles On Steroids

25 / 99

IFEATURE TOGGLES

Page 26: Feature Toggles On Steroids

26 / 99

Why Feature Toggles?

Hide unfinished features from users

Page 27: Feature Toggles On Steroids

27 / 99

Why Feature Toggles?

Hide unfinished features from users

“Stable trunk” for visible functionality

Page 28: Feature Toggles On Steroids

28 / 99

Why Feature Toggles?

Hide unfinished features from users

Separate Deployment and Release

Page 29: Feature Toggles On Steroids

29 / 99

Why Feature Toggles?

Hide unfinished features from users

Separate Deployment and Release

Fearless Deployment

Page 30: Feature Toggles On Steroids

30 / 99

Why Feature Toggles?

Hide unfinished features from users

Separate Deployment and Release

Fearless Deployment

No Big Bang Releases

Page 31: Feature Toggles On Steroids

31 / 99

Granularity

Page 32: Feature Toggles On Steroids

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● ...

Page 33: Feature Toggles On Steroids

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● ...

Page 34: Feature Toggles On Steroids

34 / 99

Granularity (example #1)

Page 35: Feature Toggles On Steroids

35 / 99

Granularity (example #2)

Quelle: http://www.togglz.org/documentation/activation-strategies.html

Page 36: Feature Toggles On Steroids

36 / 99

Granularity (example #3)

Quelle: http://abhishek-tiwari.com/post/decoupling-deployment-and-release-feature-toggles

Page 37: Feature Toggles On Steroids

37 / 99

Why Feature Toggles?

Hide unfinished features from users

Separate Deployment and Release

Fearless Deployment

No Big Bang Releases

Page 38: Feature Toggles On Steroids

38 / 99

Why Feature Toggles?

Hide unfinished features from users

Separate Deployment and Release

Fearless Deployment

No Big Bang Releases

Better Software Architecture

Page 39: Feature Toggles On Steroids

39 / 99

Feature Toggle = Feature Toggle|

Page 40: Feature Toggles On Steroids

40 / 99

Feature Toggle = Feature Toggle|

long lived,payed for by customer

Page 41: Feature Toggles On Steroids

41 / 99

Feature Toggle = Feature Toggle|

long lived,payed for by customer

Business

Toggle

Page 42: Feature Toggles On Steroids

42 / 99

Feature Toggle = Feature Toggle|

long lived,payed for by customer

short lived,payed for by your company

Business

Toggle

Page 43: Feature Toggles On Steroids

43 / 99

Feature Toggle = Feature Toggle|

long lived,payed for by customer

short lived,payed for by your company

Business

ToggleBusiness

Toggle

ReleaseToggle

Page 44: Feature Toggles On Steroids

44 / 99

Release Toggle = Release Toggle|

Page 45: Feature Toggles On Steroids

45 / 99

Release Toggle = Release Toggle|

hides a new feature

Page 46: Feature Toggles On Steroids

46 / 99

Release Toggle = Release Toggle|

hides a new feature

e.g. new functionality (new menu point, new dialog, ...)

Page 47: Feature Toggles On Steroids

47 / 99

Release Toggle = Release Toggle|

hides a new feature

e.g. new functionality (new menu point, new dialog, ...)

hides a new implementation

Page 48: Feature Toggles On Steroids

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) - ...

Page 49: Feature Toggles On Steroids

49 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 50: Feature Toggles On Steroids

50 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 51: Feature Toggles On Steroids

51 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 52: Feature Toggles On Steroids

52 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 53: Feature Toggles On Steroids

53 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 54: Feature Toggles On Steroids

54 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 55: Feature Toggles On Steroids

55 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

Page 56: Feature Toggles On Steroids

56 / 99

Branch By Abstraction

Quelle: http://martinfowler.com/bliki/BranchByAbstraction.html

You wanna keep this

Page 57: Feature Toggles On Steroids

57 / 99

Why Feature Toggles?

Hide unfinished features from users

Separate Deployment and Release

Fearless Deployment

No Big Bang Releases

Better Software Architecture

Page 58: Feature Toggles On Steroids

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

Page 59: Feature Toggles On Steroids

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

Page 60: Feature Toggles On Steroids

60 / 99

Release Toggle = Release Toggle|

hides a new feature hides a new implementation

Page 61: Feature Toggles On Steroids

61 / 99

Release Toggle = Release Toggle|

hides a new feature hides a new implementation

Dark Launching Pattern

Page 62: Feature Toggles On Steroids

62 / 99

Dark Launching (example)

Page 63: Feature Toggles On Steroids

63 / 99

Release Toggle = Release Toggle|

hides a new feature hides a new implementation

Dark Launching Pattern

Beta-TestingA/B-Testing

Page 64: Feature Toggles On Steroids

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

Page 65: Feature Toggles On Steroids

65 / 99

Branch By Abstraction

Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/

Page 66: Feature Toggles On Steroids

66 / 99

Branch By Abstraction

Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/

Page 67: Feature Toggles On Steroids

67 / 99

Verify Branch By Abstraction

Quelle: http://www.stephen-smith.co.uk/application-pattern-verify-branch-by-abstraction/

Page 68: Feature Toggles On Steroids

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

Page 69: Feature Toggles On Steroids

69 / 99

Implementation: 2 Feature Toggles

Use new implementation?

Verify new implementation?

Page 70: Feature Toggles On Steroids

70 / 99

Implementation: 2 Feature Toggles

Page 71: Feature Toggles On Steroids

71 / 99

Implementation: 2 Feature TogglesU

se n

ew im

ple

men

tatio

n?

Verify new implementation?

Page 72: Feature Toggles On Steroids

72 / 99

Implementation: 2 Feature TogglesU

se n

ew im

ple

men

tatio

n?

Verify new implementation?

Use old code

Page 73: Feature Toggles On Steroids

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

Page 74: Feature Toggles On Steroids

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

Page 75: Feature Toggles On Steroids

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

Page 76: Feature Toggles On Steroids

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

Page 77: Feature Toggles On Steroids

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

Page 78: Feature Toggles On Steroids

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

Page 79: Feature Toggles On Steroids

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

Page 80: Feature Toggles On Steroids

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

Page 81: Feature Toggles On Steroids

81 / 99

Verify Pattern (example)

Page 82: Feature Toggles On Steroids

82 / 99

Verify Pattern (example)

Page 83: Feature Toggles On Steroids

83 / 99

Verify Pattern (example)

Page 84: Feature Toggles On Steroids

84 / 99

Verify Pattern (example)

Page 85: Feature Toggles On Steroids

85 / 99

Verify Pattern (example)

Page 86: Feature Toggles On Steroids

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

Page 87: Feature Toggles On Steroids

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?

● ...

Page 88: Feature Toggles On Steroids

88 / 99

What should the system doif an asynchronous verify fails?

Logging Metriken

Page 89: Feature Toggles On Steroids

89 / 99

What should the system doif an asynchronous verify fails?

Logging Metriken

Page 90: Feature Toggles On Steroids

90 / 99

Which library should you usefor Feature Toggles?

Page 91: Feature Toggles On Steroids

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

Page 92: Feature Toggles On Steroids

92 / 99

When do you deleteold Feature Toggles?

When you are confident

Page 93: Feature Toggles On Steroids

93 / 99

When do you deleteold Feature Toggles?

When you are confident

(probably serveral weeks after you activated the

Feature Toggle globally)

Page 94: Feature Toggles On Steroids

94 / 99

Testing with Feature Toggles –Combinatorial Explosion?

Page 95: Feature Toggles On Steroids

95 / 99

Testing with Feature Toggles(example #1)

Page 96: Feature Toggles On Steroids

96 / 99

Testing with Feature Toggles(example #1)

Page 97: Feature Toggles On Steroids

97 / 99

Testing with Feature Toggles(example #2)

Quelle: https://gist.github.com/MichaelTamm/d5a5a67460d7a2db08a4

Page 98: Feature Toggles On Steroids

98 / 99

Testing with Feature Toggles(example #3)

Page 99: Feature Toggles On Steroids

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