Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

Multiple Buckets

2 replies [Last post]
  • Login or register to post comments
Thu, 05/31/2012 - 12:01
Bhuvana Krishna...
Offline
Joined: 05/30/2012
Groups: None

Is it a good idea to create multiple buckets, one for each document type (roughly equal to one bucket per table in the schema world). If not, what is the right approach for organizing data? Currently, we have all our data in the default bucket, it is inconvenient.

Top
  • Login or register to post comments
Mon, 06/04/2012 - 06:17
rags
rags's picture
Offline
Joined: 12/29/2011
Groups: None

Bhuvana:

This is certainly a feasible approach.

For example, refer to

http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writi...

Refer to the Using Document Types which talks about storing different data types in different buckets.

Also, Buckets are resource units (such as RAM quota, replication, etc.) within Couchbase.

Rags

Top
  • Login or register to post comments
Sat, 09/15/2012 - 13:51
dipti
Offline
Joined: 11/02/2011
Groups:

Hi Bhuvana,

Bucket are similar to databases rather than tables. Depending on your hardware we would recommend some where from 2-4 buckets to 7-10 buckets.

If you take a look at the architecture, http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-architectur... you will see that for each bucket, an instance of the bucket engine (component) is created. Each bucket takes up a part of memory and it is managed independently. Using multiple buckets could lead to heavy CPU usage. So creating multiple buckets does have an impact on the system.

Given the power of Javascript map functions, multiple objects can be stored in the same bucket, and secondary indexes can be created on attributes for each document type.

Example:

function(doc, meta) {
if (doc.jsonType == "player") {
emit(doc.experience, doc);
}
}

More examples and information on views can be found here:

- http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writi...
- http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-sampl...

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker