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

Be Gentle with your prod

Be Gentle with your prod

Talk given with @odolbeau at the 2016 PHP Tour

Benjamin De Bernardi

May 24, 2016
Tweet

More Decks by Benjamin De Bernardi

Other Decks in Technology

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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.

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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.

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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%

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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!

    View full-size slide

  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!

    View full-size slide

  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/

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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)

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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)

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  88. PHP Tour Clermont-Ferrand 2016 - Be gentle with your production @odolbeau & @genes0r
    Thank you
    https://joind.in/talk/202e1
    BlaBlaCar is hiring !

    View full-size slide