$30 off During Our Annual Pro Sale. View Details »

Splitting a Monolith Using Feature Flags

Joy Ebertz
October 28, 2020

Splitting a Monolith Using Feature Flags

Presented at API World 2020

Joy Ebertz

October 28, 2020
Tweet

More Decks by Joy Ebertz

Other Decks in Technology

Transcript

  1. Who am I? • At Box • Worked on many

    aspects of splitting a monolith • Architecture • Authorization service • Service moving functionality • At Split • Work on a feature flagging system • Starting to think through splitting our monolith
  2. Agenda • What are feature flags? • Why split a

    monolith? • Challenges of Splitting a Monolith • How can feature flags help?
  3. Other Terms • Feature Toggle • Feature Flip • Feature

    Switch • Conditional Feature • Split
  4. Main Use-Cases • Releasing features • Production Testing • A/B/C

    Testing • Custom Packages • Temporary UI Customization
  5. Main Use-Cases • Releasing features • Production Testing • A/B/C

    Testing • Custom Packages • Temporary UI Customization
  6. </>

  7. Controllers Models Actions New Actions New New Actions Commands Views

    Services Resolvers Runmode Smarty/Brainy Templates Webapp Controller Webapp DataProvider
  8. Controllers Models Actions New Actions New New Actions Commands Views

    Services Resolvers Runmode Smarty/Brainy Templates Webapp Controller Webapp DataProvider
  9. Why is your code dead? Method no longer referenced Parameter

    never has certain values Endpoint never called
  10. private void logForCleanup(String orgId, String uid) { if (Treatments.ON .equals(_splitClient.getTreatment(orgId,

    Splits.CLEANUP.name()))) { String message = String.format(“CODE NOT DEAD UID: %s”, uid); log.info(message); } }
  11. private void logForCleanup(String orgId, String uid) { if (Treatments.ON .equals(_splitClient.getTreatment(orgId,

    Splits.CLEANUP.name()))) { String message = String.format(“CODE NOT DEAD UID: %s”, uid); log.info(message); } } Turn on CLEANUP split to 1%
  12. 1. Roll out to 1% 2. Remove any lines hit

    3. Roll out to 5% 4. Remove any lines hit 5. Roll out to 100% (leave here as long as makes you comfortable) 6. Remove any code that hasn’t been hit
  13. Summary • What are feature flags? • Why split a

    monolith? • Challenges of Splitting a Monolith • How can feature flags help? • Remove dead code • Load test • Parity check • Gradual roll out/kill switch