TommyT
TommyT

Reputation: 1797

How to check a particular bucket capacity in couchbase?

How to check a particular bucket capacity in couchbase? So, if its going to reach its capacity make a new bucket and start inserting data into that bucket .. Can that be done .. Java API..

My question is .. If we have a big data set that we need to insert into couchbase and if the bucket size is not enough ... and I am using rest API to make that happen .. Is there a way I can do something like .. if(bucket has reached capacity) create another bucket dynamically createbucket( ) and insert data now into this newly created bucket

Upvotes: 0

Views: 1175

Answers (2)

Tug Grall
Tug Grall

Reputation: 3520

In addition to @m03geek answer:

So the first answer, do not use "buckets" to manage space. The DD are the same for all buckets. (You can just select DD for data and another DD for indexes).

So the limit is the size of your disk, remember that you distribute the data on many nodes, so we can say that the space for you database is the sum of the free space on all nodes.

It is also important to remember that couchbase has two types of files:

  • data
  • index

(and some replicas)

All data in files are managed using a append only approach, this means that the files grow, then it is compacted. You can find more information about this here:

Also when you are creating a bucket you have to set the RAM quota, to limit the size of the cache that is used to store all metadata, and cache the values. Once again this is distributed on all nodes of the cluster, for example if you have a 5 nodes cluster and you put 2GB or RAM quotas for your bucket, you have 10GB or RAM available for this bucket. The space is managed automatically by Couchbase that removes (after data has been persisted on disk) data from the RAM when necessary.

Finally, if you are looking for some stats from your cluster you can access many of them using the REST API documented here: http://www.couchbase.com/docs/couchbase-manual-2.1.0/couchbase-admin-restapi.html

Upvotes: 2

m03geek
m03geek

Reputation: 2538

Couchbase bucket size is equal to free disk space. So if you have i.e. 1Tb HDD and create one bucket it's capacity will be 1Tb. If you create 2 buckets or 100 buckets, the capacity of your HDD will not change. So if you run out of bucket size - buy more HDDs. The bucket size that you've write in admin console is how much RAM memory couchbase can consume to store frequently asked keys, but not to store data.

Upvotes: 1

Related Questions