pen4education
FEATURE FLAGS AND
CONTROLLED RELEASES
Eduardo Colabardini
Chapter Leader @ Moip
eduardocolabardini@gmail.com
@ecolabardini
Lucas Queiroz
Software Engineer @ Moip
lucascqueiroz97@gmail.com
@lucascqueiroz97
pen4education
Agenda
• What are feature-flags?
• Common practices
• Types
• Longevity versus dynamism
• Release flags
• Real cases from Moip
• Not a silver bullet
• The superhero: IFMAN DEMO!
pen4education
What are feature-flags?
• Flags = Toggles = Bits = Flippers = Switches
• Variables used in conditional statements / strategy pattern
• A way to modify system behavior
• Enable/disable features
pen4education
Common practices
• Compiled / hardcoded
users = ['user1', 'user2']
• Command-line arguments
$ java MyApp user1,user2
• Property files
users = user1,user2
• Relational databases
> update user set role='admin' where id=1;
• Key-value stores
> sadd users user1
pen4education
Source: https://www.theverge.com/2016/1/4/10708590/facebook-google-android-app-crash-tests
pen4education
• Release
• Decouple deployment from releasing
• Canary releases - can be unstable, bleeding edge
• Alternative to feature branches
• Ops
• Operational aspects of a system
• Circuit-breaker
• Experiment
• A/B testing
• Permission
• Users permission, freemium model
Types
pen4education
Source: https://martinfowler.com/articles/feature-toggles.html
pen4education
Release flags
• Trunk-based development
• Continuous integration, delivery and
deployment
• Small commits / testing culture
• Reduce deployment risks
• Reduce costs of long lived branches
• Escape from merge hell
pen4education
Real cases from Moip
• Contestation central
• Third party transfers
• Two factor authentication
• Checkout
• OAuth 2.0
• Registered "boleto"
pen4education
Not a silver bullet
• Feature flag hell
• More test scenarios
• Keep track of feature-flags' states
• Harder to support, debug and replicate
problems
• Technical debt - "Toggle removal task" onto
the team's backlog
• Expiration dates (TTL) / fail a test
• Limit on the number of dynamic feature
flags in a system
pen4education
"Your first choice should be to break the feature
down so you can safely introduce parts of the
feature into the product. The advantages of doing this
are the same ones as any strategy based on small,
frequent releases."
- Martin Fowler
pen4education
The Superhero
https://github.com/moip
pen4education
RCurtain
pen4education
RCurtain
pen4education
JCurtain
pen4education
JCurtain
pen4education
The Superhero
pen4education
https://github.com/moip
Eduardo Colabardini
Chapter Leader @ Moip
eduardocolabardini@gmail.com
@ecolabardini
Lucas Queiroz
Software Engineer @ Moip
lucascqueiroz97@gmail.com
@lucascqueiroz97
Eduardo Colabardini
Chapter Leader @ Moip
eduardocolabardini@gmail.com
@ecolabardini
Lucas Queiroz
Software Engineer @ Moip
lucascqueiroz97@gmail.com
@lucascqueiroz97
Dúvidas?

TDC2018SP | Trilha UX - Feature flags e Releases controlados