Everything is a feature (flag)
Software releases can be stressful, which is why no one typically releases new software on a Friday night and walks away.

Usually something goes wrong. Sometimes things go right, but usually they go wrong. Even with automated testing and a crack QA team, things can still wind up going south in production for whatever reason. What if instead of slowing down and trying to get every release perfect, we hid every change behind a feature flag and released software that appeared to not have changed at all.
So here’s an example of what I mean. Let’s say a customer really wants to be able to change the text in a button that was just hardcoded in html before. This is really a three part change:
- Adding a column in a “user settings” table that can store the button text
- Getting that data out of the table and keeping the default text if the value is blank (which it will be because the customer won’t have changed it when we release the change). There’s probably a user settings page somewhere that will probably need to be updated too, but I’m just going to leave that out.
- Testing that it all works
Database changes
This is a really straightforward way to store user settings, but lets say there’s a column for every setting and this new column is going to be called button text.
alter table user_settings add button_text text
Reading the new button_text column
I love clojure, so we’ll use clojure here for the application code. Yesql, compojure, environ and hiccup.
Testing that it all works
This is a trivial change and a trivial example, so nothing will probably go wrong, but let’s say we’ve been burned before, so we’ll go ahead and hide it behind a feature flag.
There are a few cool features of checkered that I should point out here.
flags/init!is where a request is made to the checkered server to start a server sent event http connection.- Every
flags/enabled?call just checks memory from theflags/init!call so you don’t have to worry about some feature flag slowing down your app server. - There’s a dashboard that you or anyone in your team can toggle which features are on or off!
With feature flags powered by checkered in your apps, you can push code and it should appear to be exactly the same the moment it’s pushed. Then sometime after the code is out there, you or anyone in your company can log into checkered, look at the latest features available and determine which users they want to enable them for, or they can turn the feature on for everyone all at once. If something goes wrong, no worries, just turn the feature off again. No more harried engineers with people hovering over desks trying to fix what just broke, and no more disappointed customers having to wait hours or days to get their problems solved.
I’m making checkered, an open source project to help manage feature flags in your app, be sure to star it and watch for the client libraries for your favorite language, coming soon!
