Multiple membase buckets? Necessary?
Fri, 04/20/2012 - 05:15
Hi all,
Starting to use Couchbase in production but have a question.
I will use both Memcached and Couchbase, so I allocated 6GB per server in my cluster, 4GB for Couchbsae and 2GB for Memcached.
I am only wondering if it is logical / recommended to create multiple Memcached buckets for seperated 'tasks'. For example, is it best practice to create a 256MB bucket for my search results, a 1,5GB bucket for my SQL caching, and another 256MB bucket for some other cache? Or should I create a single 2GB bucket? What are the advantages of the one vs the other?
The same goes for Couchbase, but I'm only using Memcached buckets for now.
Thanks!
It's very application dependent. There are two main considerations, one of resource allocation, the other of any administration you perform (like flush).
If you put two sets of data in the same bucket, they can potentially compete for the RAM, where if they're isolated each will be able to use the full quota for itself. Also, if you separate them into buckets, you will be able to edit the resource allocation dynamically for each.
On the other hand, having one bucket is simpler for administration, as it's less to backup/restore and less decisions in the code on which bucket to use.
I hope that helps you make a decision for your app!