开发者

Rails 3 A/B Split Test System Without Redis?

开发者 https://www.devze.com 2023-04-04 10:39 出处:网络
I\'m looking for an easy way to integrate split testing into my Rails 3 application.I\'ve researched and found two alternatives that seem to be up to date for Rails 3...

I'm looking for an easy way to integrate split testing into my Rails 3 application. I've researched and found two alternatives that seem to be up to date for Rails 3...

Vanity: http://vanity.labnotes.org

Split: https://github.com/andrew/split

However, both of these use Redis, which my employer doesn't want to use. I notice that Vanity can be used with ActiveRecord instead, but I was wondering if anyone had experience with setting up an A/B Split Test system without using Redis and what configuration would you 开发者_StackOverflow中文版recommend?


I don't have experience with Split but I have setup vanity without Redis. The way to do this is to add the following to your config/environments/development.rb

Vanity.playground.establish_connection :development

Then, create a file called vanity.yml under config/ and add the following:

development:
  adapter: active_record
  active_record_adapter: mysql
  host: localhost
  database: database_name
  username: mysql_username
  password: mysql_password


You can take a look at the A/Bingo plugin. It uses ActiveRecord, and there is a RailsCasts episode on how to configure and use it.


For those of you who are looking for a simple-to-use lightweight solution for split and smoke testing, then I've developed the eeny-meeny gem. It does not require you to use Redis or anything like it. It is built as rack middleware and handle everything based on cookies.

All you need to use it is to define your experiment(s) and use the experiment helpers where you need them:

if participates_in?(:my_experiment, variation_id: :my_variation)
  # variation specific code
else
  # normal code
end

if smoke_test?(:my_secret_test)
  # smoke test specific code
else
  # normal code
end
0

精彩评论

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

关注公众号