Skip to content
nu7hatch edited this page Sep 19, 2010 · 4 revisions

Redis is default datastore for ACLatraz. This awesome key-value database is extremaly fast and scalable. Authorization mechanisms like ACLatraz can generate very high load, but Redis can handle this perfectly.

Don't have Redis yet?

Read this article on The Redis Cookbook - it should help you properly setup Redis server on your machine.

Now install the redis client for ruby. You can manage it easily from rubygems:

sudo gem install redis

If you want get to known more about Redis then you should visit its homepage.

Datastore configuration

There is few ways to initialize ACLatraz with Redis store:

  • the easiest way is to give url to redis database:

    Aclatraz.init :redis, "redis://localhost:6379/0"
    
  • You can also give already configured redis connection as second parameter, eg.

    my_redis = Redis.new(:url => "redis://localhost:6380/0")
    Aclatraz.init :redis, my_redis
    
  • or you can also give redis connection options as hash:

    Aclatraz.init :redis, :url => "redis://localhost:6379/0", :thread_safe => true 
    

Remember that you should specify dedicated Redis database only for ACLatraz!

Clone this wiki locally