Be Gentle with your prod

Be Gentle with your prod

Talk given with @odolbeau at the 2016 PHP Tour

0bd054e9a591ec3afb355f5c2c899a23?s=128

Benjamin De Bernardi

May 24, 2016
Tweet

Transcript

  1. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Benjamin de Bernardi & Olivier Dolbeau Benjamin de Bernardi & Olivier Dolbeau
  2. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r @genes0r Lead Engineer Benjamin de Bernardi
  3. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r @odolbeau Web Architect Olivier Dolbeau
  4. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r 100€ 25€ 25€ 25€ 100€ 25€
  5. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r 15M 20M 10M 5M 1M 2015 2014 2013 2012 2011 2010 2009 25M members worldwide Over 25 million members and growing 1.5 million+ joining each month
  6. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  7. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r 100+ people in the tech team
  8. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Lots of projects...
  9. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r A lot of features to test.
  10. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  11. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  12. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  13. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Deploying big features is too risky. It can’t be done for everyone at the same time anymore.
  14. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r It’s not always our fault!
  15. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Medias
  16. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  17. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Angry ops.
  18. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r An angry ops is too dangerous! We need to find a solution to maintain the website up even when the traffic is high.
  19. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Let’s define our needs.
  20. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Deactivate a feature in production
  21. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Activate a feature
  22. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Slowly rollout a new feature
  23. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Change A/B test configuration.
  24. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Feature Y is only for 10% of the Italian users... Feature Y is only for 10% of the Italian users... Feature X is for France and maybe Belgium Feature X is for France and maybe Belgium ✓ ? 10% 10%
  25. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Device agnostic
  26. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r No deployement
  27. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  28. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Feature flags Feature flags Feature flags Feature flags Feature flags
  29. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @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
  30. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r What do we need? • a storage to store all feature flags and their rules • a admin interface to create / update / delete features flags • a PHP library to use in our application
  31. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle
  32. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated
  33. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated no storage logic
  34. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated no storage logic Good choice!
  35. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Existing solutions • etsy / features • joshuaestes / feature-toggle • opensoft / rollout • qandidate / toggle deprecated no storage logic Good choice! Even better!
  36. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r http://labs.qandidate. com/blog/2014/08/18/a-new-feature- toggling-library-for-php/
  37. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Meet Qandidate\Toggle
  38. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Checking values: operators
  39. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Context
  40. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Putting it all together
  41. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  42. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r http://labs.qandidate.com/blog/2014/08/19/ open-sourcing-our-feature-toggle-api-and-ui/ API UI
  43. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r How it works for us?
  44. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r What will we explain? Storages Operators & Context Strategies Devices Administration
  45. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Storages
  46. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Storages APCu Our own implementations.
  47. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r • Primary data store • 1 key containing all toggles • 1 key / toggle containing its configuration (encoded JSON)
  48. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r • Cache layer (60 seconds) • Encapsulation FTW • Encoded JSON APCu
  49. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Strategies
  50. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Strategies
  51. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Operators
  52. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r >= >= LessThan LessThanEqual MatchesRegex Percentage Available operators EqualsTo GreaterThan GreaterThanEqual InSet = [...] < %% % >
  53. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r >= >= LessThan LessThanEqual MatchesRegex Percentage Available operators EqualsTo GreaterThan GreaterThanEqual InSet = [...] < %% % >
  54. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  55. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation
  56. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Context
  57. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Context Mainly focused on the user.
  58. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Context Can be website centric.
  59. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Context Can also be feature centric.
  60. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Manager
  61. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Views
  62. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation - Views
  63. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Devices
  64. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Mobile apps API Flags Native flags
  65. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Internal Flags Export JSON Get JSON
  66. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Internal Flags
  67. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Name Internal Flags
  68. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Strategy Internal Flags
  69. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Conditions Internal Flags
  70. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Context key Internal Flags
  71. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Flaggr Open Source Android : blablacar/flaggr-android iOS : blablacar/flaggr-ios (soon)
  72. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  73. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  74. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r We have 100+ toggles.
  75. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r We can define toggles / devices
  76. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Name Strategy Conditions summary Actions
  77. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  78. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Example
  79. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  80. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  81. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @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
  82. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Flag
  83. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Implementation
  84. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r
  85. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Feature flags?
  86. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Yes.
  87. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Questions?
  88. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production

    @odolbeau & @genes0r Thank you https://joind.in/talk/202e1 BlaBlaCar is hiring !