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

Splitting Your Monolith with Feature Flags: A Guided Tour

Joy Ebertz
September 02, 2021

Splitting Your Monolith with Feature Flags: A Guided Tour

The version used Sept 1, 2021 for the SAP event.

Joy Ebertz

September 02, 2021
Tweet

More Decks by Joy Ebertz

Other Decks in Technology

Transcript

  1. Agenda • Why split a monolith? • Strategies for Splitting

    a Monolith • Challenges of Splitting a Monolith • What are feature flags? • How can feature flags help?
  2. First Services • Low Dependencies • Backend for Frontend •

    Unusual usage patterns • Infrastructure Components • New Features • Major Remodels
  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. Why is your code dead? Method no longer referenced Parameter

    never has certain values Endpoint never called
  8. 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); } }
  9. 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%
  10. 1. Roll out to 1% 2. Remove any lines hit

    3. Roll out to 5% 4. Remove any lines hit
  11. 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)
  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 • Why split a monolith? • Strategies for Splitting

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