Into The Forrst

The official blog of Forrst.
Jul 7 '10

How we deploy new features on Forrst

A few people have asked recently about how rolling out new features is handled at Forrst. While the answer is nothing spectacular, it is something I think is hugely important to consider implementing when you’ve got a fairly active site. Flickr wrote about a few tricks they use — called feature flags and feature flippers — when building and deploying new features to the site. Flags dictate whether a specific piece of functionality is turned on or off, and flippers dictate for whom the feature is enabled or not. Forrst uses a very similar implementation (we call them buckets; you may hear others calling it that as well).

I’m currently working on a few new user-facing features for the site: being able to mark a post as a favorite to come back to later, and being able to like a comment. Both of these new features are already live on the site, but only enabled for certain users. Since Forrst gets a pretty fair amount of traffic and activity day to day, being able to gradually roll out new features (and to quickly disable them if need be) is of great benefit. Here’s an example of how it works on the site; within the template for a comment, there’s an additional logic branch:

<?php if (in_arrayi($this->current_user->username, Comment_Model::$bucket_like)): ?>
// some fancy magic here
<?php endif; ?>

The associated $bucket_like variable is simply an array of usernames for whom the feature should be enabled. (in_arrayi is a custom PHP function that behaves exactly like in_array except that it is case-insensitive.) There’s also a global config that allows me to quickly disable the comment like feature globally.

That’s basically the gist of feature flags/flippers. There are about five or six features currently enabled for a subset of users. I’m also working on migrating the underlying feature flag code to a more powerful library that supports not only username whitelists, but also stuff like enabling features for all users with an ID < 1000, and so forth.

Hopefully this sheds a little light into how we’re doing things at Forrst. It’s definitely nothing groundbreaking, but rolling out new stuff this way makes a ton of sense for us. It allows product to get to users faster, thereby getting us valuable feedback and bug reports sooner, and ultimately leading to a more solid product.

66 notes

  1. twentysix-2 reblogged this from forrst
  2. benniemosher reblogged this from forrst
  3. psql reblogged this from forrst
  4. jeffbeck reblogged this from forrst and added:
    Very nice approach the only thing that jumped...me was was that in_array would be slow...
  5. joeconyers reblogged this from forrst and added:
    was always impressed with Flickr’s process, glad...methodology as well.
  6. forrst posted this