Is there a common api such that if I switch between Redis or Memcached I don't have to change my code, just a config setting?
As long as you don't initialize the Memcached client yourself but you rely on Rails.cache
common API, switching from Memcached to Redis is just a matter of installing redis-store and changing the configuration from
config.cache_store = :memcached_store
to
config.cache_store = :redis_store
More info about Rails.cache.