Feature Flipping

Mal Curtis

What is feature flipping?

Abstract Overview

"an approach to development that helps solve some of the issues associated with risk management and quality assurance when a fast moving development team expands." Chris Campbell, 99designs

Functional Benefits

"Feature flags and flippers mean we don’t have to do merges, and that all code (no matter how far it is from being released) is integrated as soon as it is committed. Deploys become smaller and more frequent; this leads to bugs that are easier to fix, since we can catch them earlier and the amount of changed code is minimized." Ross Harmes, Flickr

Typically Dry Martin Fowler Explanation

"The basic idea is to have a configuration file that defines a bunch of toggles for various features you have pending. The running application then uses these toggles in order to decide whether or not to show the new feature." Martin Fowler, Famous Developer Type

Why would you do this?

Test new features in a live production environment

Allow stakeholders to view new features without a staging server, or a VM

Branches suck

Don't fear deployment

Easy to rollback

Phased rollout:
Test things on your users, react to responses

Users

Infrastructure

Get marketing off your back

How does it work?

Wrap content in simple conditionals

if some_feature
do some feature thing
end

Determining a feature’s state

1. Default: On or Off

2. Database / Persistent Store

3. Cookie (Oh yea.)

4. Code

User.admin?, User.member?, User.courses.size > 4

5. Performance

Load > 5, AvgResponseTime > 2s

Implementations

Ruby

Flip github.com/pda/flip

Rollout github.com/jamesgolick/rollout

Degrade github.com/jamesgolick/degrade

PHP

FeatureToggle (Symfony) github.com/marekkalnik/FeatureToggleBundle

Python

Gargoyle (Django) github.com/disqus/gargoyle

Django Waffle (Django) github.com/jsocol/django-waffle

JavaScript

FeatureFlipperJS (Node)

github.com/bigodines/feature-flipper-js

.net

FeatureToggle

github.com/jason-roberts/FeatureToggle

Groovy

GrailsFeatureToggle

github.com/ryannorris/grails-feature-toggle

Demo

Danger Zone

4.7/10 from 393 users

"Robert Downey Jr. is scraping the barrel bottoms. Billy Zane seems to have one expression: disdain/disgust. You want cliche's? This movie is one BIG cliche'." rlowe, New Orleans

Feature Flipping is not always appropriate

Database schema changes

Add, not alter

Remove when safe

Infrastructure changes

Don't create technical debt

Clean up your shit.

Que?

Mal Curtis

@snikchnz

Links

Flipping Out

code.flickr.com/blog/2009/12/02/flipping-out/

Feature Flipping

99designs.com/tech-blog/blog/2012/03/01/feature-flipping/

FeatureToggle

martinfowler.com/bliki/FeatureToggle.html

How does Etsy manage development and operations?

codeascraft.etsy.com/2011/02/04/how-does-etsy-manage-development-and-operations/

Feature Bits: Enabling Flow Within and Across Teams

www.infoq.com/presentations/Feature-Bits