Yuki Nishijima
Yuki Nishijima

Reputation: 1812

dalli vs memcached gem for rails projects on heroku

I'm planning to use memcache add-on on heroku but not sure what gem I should use for it. According to the heroku documentation, dalli is recommended but I want to use memcached gem because it's at least 2x faster than dalli.

My environment is Ruby 1.9.2-p290 and Rails 3.2.8. Both of the gems work fine on my local envinronment. Can Anyone describe why dalli is better? or memcached has any problem on heroku?

Upvotes: 3

Views: 1521

Answers (2)

Yuki Nishijima
Yuki Nishijima

Reputation: 1812

I asked the same question on google groups and got a clear answer from a heroku engineer @schneems.

The client with native c bindings Is faster but would be harder to debug if issues do appear. Unless you are doing hundreds of thousands or millions of calls to memcache per day you likely won't notice the speed difference.

Upvotes: 4

Neil Middleton
Neil Middleton

Reputation: 22238

Both will work, but as described in the DevCenter:

We recommend using dalli. Dalli supports Rails 2 & 3 and Ruby 1.8.7 & 1.9.2. It is compatible with all of our deployment stacks, and is the only gem you can use if you wish to use memcache for your sessions store in Rails 2 or 3.

Upvotes: 1

Related Questions