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

The Magic of Feature Toggles:

The Magic of Feature Toggles:

Speaker: Aki Wang, Noah Hsu
Event: iThome DevOps Day 2024

LINE Developers Taiwan

July 17, 2024
Tweet

More Decks by LINE Developers Taiwan

Other Decks in Technology

Transcript

  1. @RestController public class LayoutController { @GetMapping("/layouts/order") public ResponseEntity<?> getLayoutOrder() {

    return ResponseEntity.ok(buildLayoutOrder()); } private Map<?, ?> buildLayoutOrder() { throw new UnsupportedOperationException("Not implemented yet"); } }
  2. @RestController public class LayoutController { @GetMapping("/layouts/order") public ResponseEntity<?> getLayoutOrder() {

    boolean isLayoutOrderEnabled = false; if (isLayoutOrderEnabled) { return ResponseEntity.ok(buildLayoutOrder()); } else { return ResponseEntity.notFound().build(); } } private Map<?, ?> buildLayoutOrder() { throw new UnsupportedOperationException("Not implemented yet"); } }
  3. @RestController public class LayoutController { @GetMapping("/layouts/order") public ResponseEntity<?> getLayoutOrder() {

    return ResponseEntity.ok(buildLayoutOrder()); } private Map<?, ?> buildLayoutOrder() { return Map.of("color", "blue", "radius", "8px", "pos", "page"); } }
  4. @RestController public class LayoutController { @GetMapping("/layouts/order") public ResponseEntity<?> getLayoutOrder() {

    return ResponseEntity.ok(buildLayoutOrder()); } private Map<?, ?> buildLayoutOrder() { return Map.of("color", "green", "radius", "0px", "pos", "bottomNav"); } }
  5. @RestController public class LayoutController { @GetMapping("/layouts/order") public ResponseEntity<?> getLayoutOrder() {

    String themeName = "themeB"; switch (themeName) { case "themeB": return ResponseEntity.ok(buildThemeBLayoutOrder()); default: return ResponseEntity.ok(buildThemeALayoutOrder()); } } private Map<?, ?> buildThemeALayoutOrder() { return Map.of("color", "blue", "radius", "8px", "pos", "page"); } private Map<?, ?> buildThemeBLayoutOrder() { return Map.of("color", "green", "radius", "0px", "pos", "bottomNav"); } }
  6. longevity dynamism Release Toggles Ops Toggles Permission Toggles Experiment Toggles

    years months weeks days changes with a deployment changes with runtime re-configuration changes with each request from https://martinfowler.com/articles/feature-toggles.html
  7. Feature Toggle is second best solution. The best solution is

    to find a way to gradually integrate, without Feature Branches or Feature Toggles
  8. One SDK, any backend OpenFeatureAPI api = OpenFeatureAPI.getInstance(); api.setProvider(new OpenFlagrProvider());

    Client client = api.getClient(); Boolean isHelloWorldEnabled = client.getBooleanValue("hello-world-enabled", false); if (isHelloWorldEnabled) { System.out.println("Hello World"); }