Rails 3 A/B Split Test System Without Redis?
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
精彩评论