SlideShare a Scribd company logo
百倍速交付
~ 談Trunk-Based Development
Bryan Liu 劉栢峰 2017
Some Definitions
Long-Lived (Feature) Branch
• Creates lots of overhead
Git Flow
GitHub Flow
Short-Lived Feature Branch
• Branch’s length of life: less than 2 days
• Shared for code-review and CI only
• Easily becomes long-lived branch
https://trunkbaseddevelopment.com/short-lived-feature-branches/
Trunk-Based Development (TBD)
• Commit in trunk at least once a day
• Trunk is always in a releasable state
• Hide unfinished code with feature toggle
• Refactor with branch by abstraction
http://www.alwaysagileconsulting.com/articles/organisation-pattern-trunk-based-development/
Facts
Always the bridesmaid* from Paul Hammant
TBD
Only search few of these kings…
Also other TBD giants, ex: Google, Netflix
were not included in this startups research.
Never mind become A Category King
2000 ~ 2015 yr
600k companies
34 of them
76 % market cap
Winner-takes-all
Category King
‘‘Somewhere in the middle of this two-month process you’re going to run
across a bridge and burn it behind you.’’
‘‘LinkedIn’s big switch to continuous deployment has been linked to very
concrete and visible financial success…’’
~ Kevin Scott, the senior VP of engineering
http://www.wired.com/2013/04/linkedin-software-revolution/
https://paulhammant.com/2013/03/13/facebook-tbd-take-2/
Facebook’s
Trunk-Based Development
branching models
v.s.
release frequency
TBD & Feature Toggle
if ( ToggleManager.isEnabled(“FastCheckout”, user) ) {
useFastCheckout()
} else {
useOriginCheckout()
}
https://martinfowler.com/articles/feature-toggles.html
What’s Toggle
Business Toggle:
• A/B Testing
Low Risk Release and Zero-Downtime
• Canary Release, Dark Launch, Blue-Green deployment
• DB/Schema Migration
Decouple Feature Rollout from Code Deployment
• Re-planning
• Microservices
Some Toggle Use Cases
Canary Release / Blue-Green Deployment & A / B Testing
http://featureflags.io/
• Phased rollout
• Monitor performance
• Check user feedback
• Features in live but NOT visible to user
• Warm up cache, load DB tables with real
production traffic
• Soak test, verify performance
Dark Launch
DB / Schema Change
• Forwards & backwards compatible
• Stage roll-out with verification online
• No downtime needed
Q:
What are the requirements
to achieve previous scenarios ?
A:
• Feature toggles &
• Old and new code co-exists in the same delivery
“Get good with build-flags and
toggles” ~ Paul Hammant
“ This is also the major difference
between short-lived branch and TBD!”
Inefficiencies ...
Decouple Release from Code Deployment
• TBD reduce merge pain
• Merge hell is error prone and risky
• Inefficiency on spending time in bug fix - merge - test cycle.
As in Microservices:
Any attempt trying to set release pace is not realistic!!
Feature flags
+ Microservices
= True decoupling
Re-planning
• It happens
• Leads to weeks of un-merge for teams
Image from: https://devops.paulhammant.com/
Inefficiencies in SW development:
• It slows down throughput
• Can’t keep talent
Spotify Release Train
https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/
Frequently commits to mainline:
• More communication with your team
• More frequent builds and tests (CI)
• More frequent deployment (CD)
• More experiments and faster feedback
Implementation
Pre-Commit Testing & Code Review
• Pre-commit (CI) test (option but best)
• Continuous (code) review
• Code ownership
Figure from https://trunkbaseddevelopment.com/continuous-integration/
Why Continuous Review (Large Diffs Hurts)
• Large diffs won’t get reviewed
• Reverting large diffs is hard
• Rebasing/merging large diffs is error-prone
Code review statistics: http://blogs.atlassian.com/2011/07/creating_optimal_reviews/
Pull Request Code Review
git commit -m "fixed issue with fan"
https://zachholman.com/posts/deploying-software
Code Review Page
• Code statistics
• CI test results
• Review discussion &
comments
Trunk-Based Development
Trunk-Based Development
Hello, about me …
DevOps Evangelist
QA Architect
Bryan Liu 劉栢峰
• trunkbaseddevelopment.com

• trunk-based development, Paul Hammant

• Facebook's Trunk-Based Development, Paul Hammant

• Branch by Abstraction, Martin Fowler

• Feature Toggles, martinfowler.com

• Category King, J. Van Grove and Play Bigger

• The Death of Continuous Integration, Steve Smith

• And many links inside each slide deck ~
Reference

More Related Content

ODP
Introduction to BDD
PPTX
Behavior Driven Development
PPTX
CQRS: Command/Query Responsibility Segregation
PPT
Code coverage
PPT
TDD (Test Driven Design)
PPTX
Domain Driven Design
PDF
Successfully Implementing BDD in an Agile World
PPTX
Code Review Best Practices
Introduction to BDD
Behavior Driven Development
CQRS: Command/Query Responsibility Segregation
Code coverage
TDD (Test Driven Design)
Domain Driven Design
Successfully Implementing BDD in an Agile World
Code Review Best Practices

What's hot (20)

PPTX
Trunk Based Development in the Enterprise - Its Relevance and Economics
PDF
Trunk based development for Beginners
PPTX
Fundamentals of DevOps and CI/CD
PDF
Trunk-Based Development and Toggling
PDF
Trunk based development
PDF
Git Series. Episode 3. Git Flow and Github-Flow
PPTX
Gitlab CI/CD
PPTX
Git Pull Requests
PDF
Gitlab flow solo
PDF
Introduction to GitHub Actions
PDF
Git real slides
PDF
Git and github 101
PPTX
Master the Monorepo
PDF
Git training v10
PDF
Git Version Control System
PPTX
Intro to git and git hub
PDF
Continuous Integration/Deployment with Gitlab CI
PPT
Git basic
PPTX
Introduction to git & GitHub
PDF
Gitlab ci, cncf.sk
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk based development for Beginners
Fundamentals of DevOps and CI/CD
Trunk-Based Development and Toggling
Trunk based development
Git Series. Episode 3. Git Flow and Github-Flow
Gitlab CI/CD
Git Pull Requests
Gitlab flow solo
Introduction to GitHub Actions
Git real slides
Git and github 101
Master the Monorepo
Git training v10
Git Version Control System
Intro to git and git hub
Continuous Integration/Deployment with Gitlab CI
Git basic
Introduction to git & GitHub
Gitlab ci, cncf.sk
Ad

Similar to Trunk-Based Development (20)

PPTX
Xp conf-tbd
PDF
Trunk Based Development
PPTX
Trunk-based Development with Feature toggles
PDF
Thierry de Pauw - Feature Branching considered Evil - Codemotion Milan 2018
PDF
Pusheando en master, que es gerundio
PDF
Increasing productivity with continuous delivery
PDF
OSDC 2019 | Feature Branching considered Evil by Thierry de Pauw
PPTX
CI back to basis
PDF
Feature Toggle
PDF
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
PPTX
Lean Kanban India 2015 | Branching for Continuous Delivery? Think Again! | De...
PDF
Simulating Git workflows
PDF
Recipes for Continuous Delivery (ThoughtWorks Geeknight)
PDF
How BDD enables True CI/CD
PDF
Reflections on SCM
PDF
Continuous Integration for Citizens
PDF
Continuous Integration for Citizens
PDF
Adaptive Branching - An alternative branching strategy to existing Branching ...
PPTX
Agility Requires Safety
PPTX
ThoughtWorks Continuous Delivery
Xp conf-tbd
Trunk Based Development
Trunk-based Development with Feature toggles
Thierry de Pauw - Feature Branching considered Evil - Codemotion Milan 2018
Pusheando en master, que es gerundio
Increasing productivity with continuous delivery
OSDC 2019 | Feature Branching considered Evil by Thierry de Pauw
CI back to basis
Feature Toggle
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
Lean Kanban India 2015 | Branching for Continuous Delivery? Think Again! | De...
Simulating Git workflows
Recipes for Continuous Delivery (ThoughtWorks Geeknight)
How BDD enables True CI/CD
Reflections on SCM
Continuous Integration for Citizens
Continuous Integration for Citizens
Adaptive Branching - An alternative branching strategy to existing Branching ...
Agility Requires Safety
ThoughtWorks Continuous Delivery
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
history of c programming in notes for students .pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
medical staffing services at VALiNTRY
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Operating system designcfffgfgggggggvggggggggg
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
L1 - Introduction to python Backend.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
top salesforce developer skills in 2025.pdf
Softaken Excel to vCard Converter Software.pdf
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms I-SECS-1021-03
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
2025 Textile ERP Trends: SAP, Odoo & Oracle
VVF-Customer-Presentation2025-Ver1.9.pptx
history of c programming in notes for students .pptx
PTS Company Brochure 2025 (1).pdf.......
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
medical staffing services at VALiNTRY
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia

Trunk-Based Development