开发者

How do Google and Facebook release features to some users before others?

I am looking for suggestions on how to be able to have some users try out new versions of a web application before others.

I would like this to be transparent to the user. They wouldn't know they were running on a beta version.

One thought I had was to create a beta.domain.int and prod.domain.int and then have a load balancer send requests to one or the other. Which (if any) load balancers allow you to set a "beta=1" cookie in the application and direct their requests based on a cookie? When no beta exists, prod.domain.int would be served regardless of the cookie. The cookie would be set by users "opting in" for beta releases.

Google and Faceboo开发者_Python百科k have the ability to test new features on small groups of users before making something generally available. How are they doing this?


You are not looking for a load balancer, because a load balancer is typically used for balancing load and does not have anything to do with your actual implementation. What you need to do is implement this functionality in your application.

You take facebook as an example, since it is written in PHP I will give you a breif example ( pseudo code ) on how they might implement this:

if(isUserBetaTester()){
    include("beta_functions.php");
}
else{
    include("normal_functions.php");
}

To simulate the same functionality in .NET you can use custom attributes to determen what actions to Really run and what Views to really render since you don't want to repeatidly check in your actions / controllers if the user is a beta user or whatnot.

Consider the following ( also pseudo ) to be in your Action filtering:

if(string.IsNullOrEmpty(Cookies["beta"]))
{
    var betaModel = DataLayer.GetModelForThisAction();
    Render("BetaView", betaModel);
}
else
{
    var normalModel = DataLayer.GetModelForThisAction();
    Render("NormalView", normalModel);
}

There are numerous ways you can implement this, but keep in mind that it would probably be Much easier to add a "IsBetaUser" to the user-table in the database and have a special domain for beta-users and just check "Is this a beta user?". In that way you could add a filter on the entire domain that checks if the user is allowed or not.

My first answer included a vaughe statement of "redirect" I meant to use a server transfere which would keep the URL, but this might be a bad idea since it will change on postback.


I believe this is not a load balancing question. The question asks for suggestion on How to randomly select users for beta or updated version of the product?

There could be several ways, including, but not limited to:

  • Select users randomly or first 100 users; and redirect without their consent - not so a good idea. You can use application object; Application["MyKey"] = "BetaUserCounter++";
  • Create a optional-link(top of the screen?) on the landing page, asking users if they want to try the updated beta version. Note that you can limit this functionality; for instance, if you intend to test 100 users on the first try, you can hide the optional-link after your 100-users pool exhausts.

--EDIT--

To redirect the traffic based upon rules there could be several ways, couple of options:

  • You can look into Microsoft Application Request Routing 1.0 module, but this is for IIS7.

Application Request Routing (ARR) enables Web server administrators and hosting providers and to increase Web application reliability and scalability through rule-based routing and load balancing of HTTP server requests. With ARR, administrators can optimize resource utilization for application servers to reduce management costs for Web farms and shared hosting environments.

  • Write a custom HttpHandler (see also), that would analyze the traffic, redirect, and keep a record of redirects.


Check this one - https://github.com/reddit/reddit-plugin-betamode - it provides you an idea how to set cookie, how to use HAProxy to direct users to the beta server instead of the regular app server pool.


You can use a product like the octagate switch to distribute http traffic. With octagate you can distribute a given percentage of user sessions to a specific back-end machine, using the capacity setting. This requires no adjustments to your applications.

How do Google and Facebook release features to some users before others?


We implemented this feature in similar way as the way we enable/disable features for different clients. This is really useful for atomic features.

Each type of user have a Feature Pack (a collection of tokens). So... when rendering our web app, we check is the user has the token for certain feature (this is used to show/hide features for different plans).

For new released or in development features, we add a special token (for instance a token named "ShowBetaFeatures" and "ShowAlphaFeatures"). So if a feature is in beta and we want to make it available for a set of users, we add that Token to those users. The same to receive early feedback from certain users for the Apha stage of something.

This approach is useful if you want to enable certain feature just for one user (a custom development).

Now, if you want to change the way something is displayed (not simply showing/hidding), depending of the size of the difference you can solve it in the View itself or in the controller. Just check if the user has the token ShowBetaFeatures, and display one view or another... or if it is inside a view display the chunk of HTML you need.

If the decision to display Beta features is done in Controller level, you can add an action filter to do that for you. The code in your action filter will do the if/else and checking if the user can view the Beta features. Once the Beta features are released to main population... you can remove those decorations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜