Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Splitting Your Monolith with Feature Flags: A G...
Search
Joy Ebertz
September 02, 2021
Technology
0
29
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
Share
More Decks by Joy Ebertz
See All by Joy Ebertz
How Much Should Staff+ Code? StaffPlus NYC 2023
jkebertz
0
190
Elevate_23_Advanced_FF_Usecases.pdf
jkebertz
0
29
Feature Flag Use Cases You Haven't Heard About Yet
jkebertz
0
36
So You Want to Split Your Monolith: First Steps
jkebertz
0
37
How to Split a Monolith: Service Architecture & Domain-Driven Design (DDD)
jkebertz
0
430
Splitting a Monolith Using Feature Flags
jkebertz
0
91
Other Decks in Technology
See All in Technology
Amazon S3標準/ S3 Tables/S3 Express One Zoneを使ったログ分析
shigeruoda
3
400
OAuth/OpenID Connectで実現するMCPのセキュアなアクセス管理
kuralab
5
890
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
170
~宇宙最速~2025年AWS Summit レポート
satodesu
1
1.5k
In Praise of "Normal" Engineers (LDX3)
charity
3
1.2k
Snowflake Summit 2025全体振り返り / Snowflake Summit 2025 Overall Review
mtpooh
2
290
Amplifyとゼロからはじめた AIコーディング 成果と展望
mkdev10
1
370
Claude Code Actionを使ったコード品質改善の取り組み
potix2
PRO
4
1.7k
データプラットフォーム技術におけるメダリオンアーキテクチャという考え方/DataPlatformWithMedallionArchitecture
smdmts
5
570
ObsidianをMCP連携させてみる
ttnyt8701
2
140
監視のこれまでとこれから/sakura monitoring seminar 2025
fujiwara3
10
2.9k
CSS、JSをHTMLテンプレートにまとめるフロントエンド戦略
d120145
0
240
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
Making Projects Easy
brettharned
116
6.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Docker and Python
trallard
44
3.4k
The Cult of Friendly URLs
andyhume
79
6.4k
The Cost Of JavaScript in 2023
addyosmani
51
8.4k
Why Our Code Smells
bkeepers
PRO
337
57k
Designing for humans not robots
tammielis
253
25k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Practical Orchestrator
shlominoach
188
11k
Transcript
A Guided Tour Splitting Your Monolith with Feature Flags Joy
Ebertz Sr Staff Engineer
Agenda • Why split a monolith? • Strategies for Splitting
a Monolith • Challenges of Splitting a Monolith • What are feature flags? • How can feature flags help?
Why Should We Split a Monolith?
What do I mean by “Splitting a Monolith?”
None
None
None
None
None
None
Why Split a Monolith? Code Entanglement
None
None
None
None
None
Unclear Ownership
None
None
None
None
Deployment Problems
Build Test Deploy
Build Test Deploy
Build Test Deploy
Build Test Deploy
Build Test Deploy
Build Test Deploy
None
None
None
None
10% 10% 10% Deploy 72% Chance Of Success
10% 10% 10% Deploy 53% Chance Of Success 10% 10%
10%
10% 10% 10% Deploy 28% Chance Of Success 10% 10%
10% 10% 10% 10% 10% 10% 10%
Deploy 1% Chance Of Success
Deploy
Deploy
Deploy
Deploy
Issue Remediation
Deploy
Strategies for Splitting a Monolith
Big Bang Pattern
Big Bang Pattern Old Application
Big Bang Pattern New Application Old Application
Big Bang Pattern New Application Old Application
Big Bang Pattern New Application Old Application
Big Bang Pattern Advantages • Easier to remove features •
Less Transition State Work
Strangler Fig Pattern Martin Fowler
Strangler Fig Pattern Old Application
Strangler Fig Pattern Old Application
Strangler Fig Pattern Old Application
Strangler Fig Pattern Old Application
Strangler Fig Pattern Old Application New Application
Strangler Fig Pattern Advantages • Less Risk • Lower time
to first benefit • Easier to sell
None
None
Where to Start
Service Map
Requests Monolith logic
Requests Monolith logic Interface
Requests Monolith logic New Microservice Interface Interface
Requests Monolith logic New Microservice Interface Interface
Requests Monolith logic New Microservice Interface Interface
What should my first service be?
First Services Edges
First Services BFF (Backend for Frontend) or Application Services
First Services BFF Application Service Application Service Application Service
First Services Problematic Functionality
First Services Infrastructure Services Authentication
First Services Infrastructure Services Authentication Event Bus
First Services Infrastructure Services Authorization Authentication Event Bus
First Services New Features
First Services Things Undergoing Major Changes
First Services • Low Dependencies • Backend for Frontend •
Unusual usage patterns • Infrastructure Components • New Features • Major Remodels
Challenges of Splitting a Monolith
None
Original Code Tangled
None
Entirely Separate Talk
Trying to Replicate Functionality
Entirely New Infrastructure
Entirely New Infrastructure
RISKY
So, how can we mitigate the risks?
What Are Feature Flags?
Other Terms • Feature Toggle • Feature Flip • Feature
Switch • Conditional Feature • Split
Code Branch Controlled by GUI
Code Sample if (Treatments.ON .equals(_splitClient.getTreatment(orgId, Splits.MY_FEATURE.name()))) { // Do Something
} else { // Do Something Else }
None
Code Sample if (Treatments.ON.equals(_splitClient.getTreatment(orgId, Splits.MY_FEATURE.splitName()))) { // Do Something }
else { // Do Something Else }
Main Use-Cases
Main Use-Cases • Releasing features
Main Use-Cases • Releasing features • Production Testing
Main Use-Cases • Releasing features • Production Testing • A/B/C
Testing
Main Use-Cases • Releasing features • Production Testing • A/B/C
Testing • Custom Packages
Main Use-Cases • Releasing features • Production Testing • A/B/C
Testing • Custom Packages • Temporary UI Customization
Main Use-Cases • Releasing features • Production Testing • A/B/C
Testing • Custom Packages • Temporary UI Customization
Releasing Features • Separating Deploy from Release • Canary/Ramped Deployment
• Off Switch
Deploy Release
</>
</> User
Prod User
Prod User
Prod Developer
Prod Developer
Prod User
Prod User Split
Prod User Split OFF OFF
Prod User Split OFF
Prod User Split OFF
Prod Split Product Owner OFF
Prod Split Product Owner ON
Prod User Split ON
Prod User Split ON
Prod User Split ON
Prod User Split ON
Prod Developer
Prod Developer
Prod User Split 10%
Prod User Split 20%
None
None
Using Feature Flags to Split a Monolith
Minimize Move
Remove Dead Code
Why is your code dead?
Why is your code dead? Method no longer referenced
Why is your code dead? Method no longer referenced Endpoint
never called
Why is your code dead? Method no longer referenced Parameter
never has certain values Endpoint never called
None
log.info(“CODE NOT DEAD UID: 12345”);
None
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); } }
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%
1. Roll out to 1%
1. Roll out to 1% 2. Remove any lines hit
1. Roll out to 1% 2. Remove any lines hit
3. Roll out to 5%
1. Roll out to 1% 2. Remove any lines hit
3. Roll out to 5% 4. Remove any lines hit
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)
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
None
Stress Test Your New Systems
None
Requests Monolith logic New Microservice Mirrored Traffic
Requests New Microservice Mirrored Traffic Feature Flag Check Monolith logic
Requests New Microservice Mirrored Traffic Feature Flag Check Monolith logic
Requests New Microservice Mirrored Traffic Feature Flag Check Monolith logic
Verify Parity
Requests New Microservice Feature Flag Parity Check Monolith logic
Requests New Microservice Feature Flag Parity Check Monolith logic
Requests New Microservice Feature Flag Parity Check Monolith logic
Requests New Microservice Feature Flag Parity Check Monolith logic
Requests New Microservice Feature Flag Parity Check Monolith logic Log
if different
Requests New Microservice Feature Flag Parity Check Monolith logic Log
if different
Requests New Microservice Feature Flag Parity Check Monolith logic Log
if different
• Treatments.OLD
• Treatments.OLD • Treatments.NEW
• Treatments.OLD • Treatments.NEW • Treatments.MIRROR
• Treatments.OLD • Treatments.NEW • Treatments.MIRROR • Treatments.PARITY
• Treatments.OLD • Treatments.NEW • Treatments.MIRROR • Treatments.PARITY Default OFF
treatment
Requests New Microservice Monolith logic Treatments.OLD
Requests New Microservice Monolith logic Treatments.NEW
Requests New Microservice Mirrored Traffic Monolith logic Treatments.MIRROR
Requests New Microservice Monolith logic Treatments.PARITY Parity Check
Slowly Roll Over Traffic
Slowly Roll Over Traffic Test Traffic Only
Slowly Roll Over Traffic Internal Users
Slowly Roll Over Traffic 1%
Slowly Roll Over Traffic Free Users
Slowly Roll Over Traffic
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
What Are Feature Flags? Joy Ebertz @jkebertz Thank You!