Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Features flags at BlaBlaCar

Features flags at BlaBlaCar

Talk given at ParisWeb 2016 with @genes0r

Olivier Dolbeau

September 30, 2016
Tweet

More Decks by Olivier Dolbeau

Other Decks in Programming

Transcript

  1. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Benjamin de Bernardi & Olivier Dolbeau Benjamin de Bernardi & Olivier Dolbeau Feature Flags at
  2. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Benjamin De Bernardi Lead Engineer Since 2014 @genes0r
  3. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Olivier Dolbeau Web architect Since 2012 @odolbeau
  4. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    15M 20M 10M 5M 1M 2015 2014 2013 2012 2011 2010 2009 25M members worldwide Over 35 million members and growing 1.5 million+ joining each month 35M 2016
  5. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Agenda • Past ◦ BlaBlaTech ◦ Fail Learn Succeed • Now ◦ Why feature flags rocks? ◦ What about the implementation? • Future
  6. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Features & people 100+ people in the tech team. • Code • Test • Deliver (fast) AT THE SAME TIME!
  7. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Deploying big features is too risky. It can’t be done for everyone at the same time anymore.
  8. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Testing a feature with 25M users is not a solution. We need to be able to test a feature only in a country or for some users.
  9. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    The “Capital effect” must not happen anymore. We need to find a solution to maintain the website up even when the traffic is high.
  10. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Feature flags Feature flags Feature flags Feature flags Feature flags
  11. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    A 'Feature Flag' (or Feature Toggle) is the ability to turn features (sub-sections) of your application on/off at a moments notice. Wikipedia
  12. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    What do we need? • a storage to store all feature flags and their rules • an admin interface to create / update / delete feature flags • a PHP library to use in our application
  13. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle
  14. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated
  15. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated no storage logic
  16. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated no storage logic Good choice!
  17. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated no storage logic Good choice! Even better!
  18. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    http://labs.qandidate.com/blog/2014/08/18 /a-new-feature-toggling-library-for-php/
  19. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    http://labs.qandidate.com/blog/2014/08/19/ open-sourcing-our-feature-toggle-api-and-ui/ API UI
  20. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    What will we explain? Storages Strategies Operators & Context Devices Administration
  21. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    • Primary data store • 1 key containing all toggles • 1 key / toggle containing its configuration (encoded JSON)
  22. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    • Cache layer (60 seconds) • Encapsulation FTW • Encoded JSON APCu
  23. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    >= >= LessThan LessThanEqual MatchesRegex Percentage Available operators EqualsTo GreaterThan GreaterThanEqual InSet = [...] < %% % >
  24. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Implementation - Context Mainly focused on the user.
  25. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Implementation - Context Can be website centric.
  26. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Can also be feature centric. Implementation - Context
  27. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Flaggr Open Source Android : blablacar/flaggr-android iOS : blablacar/flaggr-ios (soon)
  28. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Name Strategy Conditions summary Actions
  29. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Basic settings 1. User id 2. Website locale 3. User percentage 4. User phone extension 5. Currency
  30. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Rules 1. Displayed in France only a. Will be activated for other countries later (BE, PL, NL) 2. Two kinds of results a. Beginners only b. Cheapest rides 3. Only for logged users 4. Activate for 50% of the users to control the impact
  31. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Geo based conditions • Axis between cities • GeoJSON inside ElasticSearch
  32. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Features activation & A/B test Partnership with on Paris - Lyon Partnership with on Paris - Nancy Geo based conditions
  33. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Internal A/B test tool. Why ? • External tools are JavaScript based (GTM & Optimizely) • Upgrades upon need
  34. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Internal A/B test tool. New settings • User grade
  35. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    Internal A/B test tool. New settings • Visitor group ◦ Cookie set by Nginx ◦ 18 groups
  36. ParisWeb 2016 - Feature flags @ BlaBlaCar @odolbeau & @genes0r

    To improve • Feature flag removal • Deal with permissions - In progress • Use a flag for “old” features • Naming!