In this blog post I am going to introduce a new service for Ruby On Rails developers, that I have been working on, called FluidFeatures that helps you manage rolling out new features to your site and provides a way to easily do A/B testing (competing versions of a feature) right in the belly of your code.
I wrote a post back in December called, “Rollout, Degrade, Metrics and Capacity” which focused heavily on the Ruby gems rollout and degrade, created by James Golick. If you’ve used those popular gems or are thinking of using them, then FluidFeatures is also worth a look, though offers a slightly different feature set.
What does it do?
FluidFeatures is based around giving you control over which users see which versions of which features. Once you’ve installed the gem and added your credentials to your app you can start wrapping chunks of your code in feature blocks.
What do I do?
You can do something like this inside your controller code…
if fluidfeature("weather") # Implement the weather here. Is there nothing Ruby can't do? end
This will add a simple feature to your site which will be disabled by default. The first request that hits this code path with report back to the FluidFeatures there is a new feature available and that this feature is initially disabled.
As if by magic, if you believe in such things, a new widget for this feature will pop up on your control panel and allow you either enable this feature when you are ready, or slowly roll it out to 1, 2, 3… 10, 20, 30% of your user base.
The following code snippet is a slightly more complex example, again sticking with the weather. To keep things simple in this example, we are just pushing names of icons onto an Array. The Array will contain icons names for all the features that are enabled.
# This is an existing feature, so we set it's initial enabled state to fully on. # This will be the "default" version of the feature. if fluidfeature("weather", { :enabled => true }) @icons << "weather" end # This version of the "weather" feature we're calling "rainbows". # When we first rollout this feature, it will be fully disabled. if fluidfeature("weather", { :version => "rainbows" }) @icons << "rainbows" end if fluidfeature("weather", { :version => "sunshine" }) @icons << "sunshine" end
Some of our users will see the “default” weather icon when visit our site. Others will see either rainbows or sunshine. Ok, probably it is hard to see rainbows without sunshine, but we will overlook this meteorological technicality for the sake of demonstration purposes.
In reality, your features will be much more complex than this and the only limitation of what a “feature” can be is limited only by what you can put in an “if” statement.
The Dashboard
The above code will add these 3 versions of the “weather” feature to your application dashboard, within FluidFeatures.com.

You will notice that each version has 2 green bars. The top one you control to set what percentage of your user-base will see each version. The sum of all the versions can not go over 100%, so it will stop once the total of versions comes to 100%. The second bar is the percentage of your user-base that saw each version on their most recent visit. Since all your users are not hitting your site every second, this second bar will gradually move up or down to match the top bar and will give you an overview of where you are at.
More Coming Soon…
The above example code snippets are part of demo application we have built called UserViews that you can download from github.com
In a follow-up post I will demonstrate, step-by-step, how to install the fluidfeatures-rails gem and the demo application, UserViews, so that you can try out FluidFeatures for yourself.
Tell me more…
Sign-up to FluidFeatures Beta Users mailing-list if you are Ruby On Rails developer and this is a service you are interested in using.

