Slide 1

Slide 1 text

1

Slide 2

Slide 2 text

What Is Feature Toggle Feature toggle is if/else controls in your code. Easily manage features without pushing a change. 2 A task: To enhance the daily lottery algorithm def old_daily_lottery_alg: # current implementation lives here def new_daily_lottery_alg: # TODO: implement better lottery alg Code without using feature toggle def daily_lottery_logic: # SWITCH TO TRUE IF YOU ARE WORKING ON THE NEW LOTTERY ALG use_new_alg = False if use_new_alg: new_daily_lottery_alg() else: old_daily_lottery_alg() Code using feature toggle def daily_lottery_logic: if feature_is_enabled("new_lottery_alg"): new_daily_lottery_alg() else: old_daily_lottery_alg()

Slide 3

Slide 3 text

Use Case for E-commerce Use feature toggle to improve flexible developing schedule. 3 5/1 Complete code 5/3 Release data 5/5 Release data 5/6 Release data With Feature Toggle 5/1 Deploy code API related to client A API related to client B API related to client C 5/6 Deploy code Blocked by 3rd party services Feature Release Code Deployment Without Feature Toggle API related to client A API related to client B API related to client C A B C A B C

Slide 4

Slide 4 text

Use Case for E-commerce Incrementally and safely release a new feature to your users 4 Engineering Sales Product EC Team Release Feedback Feature Toggle FEEDBACK LOOP PERCENTAGE ROLLOUT(%) 30%

Slide 5

Slide 5 text

The Concept of Distributing Users Take the unique user ID, hash it using a hash function that has a uniform distribution and then mod bucket number. 5 Distribution ON OFF 0~299 300~999 Algorithm Uid: A1234 Hashed Uid: 2615402659 [0, 999] 659 Con fi g Variants: - On - Off Segment 1(All users): - Constraint: None - Rollout Percentage: 30%

Slide 6

Slide 6 text

Use Case for E-commerce More than on/off, we can set multi-variants, such as red, green and blue. 6 Result Segment(s) On Off if (variant == "on") { [SHOW FEATURE] } if (variant == "off") { [NOT SHOW FEATURE] } Your Code Variants Randomly choose 20% of users to see shopping cart. VIP Golden Normal Red Blue Green if (variant == "red") { [SHOW RED PAGE] } if (variant == "blue") { [SHOW BLUE PAGE] } if (variant == "green") { [SHOW GREEN PAGE] } Show different page color to different membership.

Slide 7

Slide 7 text

7 Structure of a Toggle System Take Flagr as an example.

Slide 8

Slide 8 text

Toggle CRUD Life Cycle Retiring toggles to avoiding technical debt! 8 • Development team create toggles when required. • Application read or expose toggled feature when they are switched ON. • Development team update toggled features when they are buggy. • A semi-automated process to destroy or remove toggles when job is done. Source: Feature Toggles (aka Feature Flags)

Slide 9

Slide 9 text

Why FT makes development faster and safer? 9 Feature Release Code Deployment • Modify system behavior without changing code • Test a new feature without needing a separate testing environment. • Reduce release risk with an instant kill switch.

Slide 10

Slide 10 text

Thank you 10