I am storing database query results in memcache on heroku. I am using memcachier addon on heroku. For example if I have a cache User's tasks in memcache. I do something like this:
def cached_tasks
Rails.cache.fetch([:users, id, :tasks], :expires_in => 12.hours) { tasks.to_a }
end
This works perfectly fine but I want to use two different memcache instances to store data.
Why?
One that is used very frequently, basically data changes frequently and another for those which are big data objects and those will never change or very rarely.
How can I use two different instances and specify that cached_tasks should be stored in memcache_instance_1 and other like cached_images should be stored in memcache_instance_2
Why not to use the same one:
Because sometimes I need to flush the whole cache and that will flush the big data too which I don't want to.
Any suggestions?