Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 1.8.x

Load balancer

3 replies [Last post]
  • Login or register to post comments
Fri, 03/30/2012 - 05:55
satishkoritala
Offline
Joined: 03/09/2012
Groups: None

Hi,
Is there any way to achieve load balance on couchbase nodes ?. I am using spymemcached client.

Top
  • Login or register to post comments
Fri, 03/30/2012 - 16:26
mikew
Offline
Joined: 03/14/2011
Groups:

Couchbase Sever uses consistent hashing to make sure that data is spread equally through out all nodes in the cluster. Check out the couchbase java client which is based off of Spymemcached.

http://www.couchbase.com/develop/java/current

Top
  • Login or register to post comments
Fri, 03/30/2012 - 23:53
satishkoritala
Offline
Joined: 03/09/2012
Groups: None

Thanks for the response. sorry mike if i would have not clear in my question.Let me make it clear :

we all know that data is stored on one master(m1) server and replicated to some of the servers(r1,r2);

My requirement is when I enabled replication, is there any way to equally load the master server and replicated servers for any key i.e

get("key1") : 1st time request should fetch value from master
2nd time request should fetch value from replica1
3rd time request should fecth value from replica2
4th time request should fetch value from master
5th time request should fetch value from replica1
6th time request should fecth value from replica2
..
..
nth time from master
n+1 time from replica

i.e i don't want the client always points to master server for any key. client should use both master and replica servers for get and set operations.

Top
  • Login or register to post comments
Sun, 04/01/2012 - 12:02
mikew
Offline
Joined: 03/14/2011
Groups:

I wouldn't recommend this type of behavior. The reason is that master and replica vbuckets are spread equally across the cluster. In Couchbase there is no such thing a node that only contains replica items. As a result if you have a 3 node cluster and do 1000 ops/sec you can expect that each node receives roughly 1000 of ops/sec so your operations should be balanced across the cluster.

Where a scheme like the one you are talking about really helps is when a node that only holds replica data and would just be sitting idle in your cluster. In Couchbase this will never happen. Another reason that replica reads are bad is that you open up the possibility of reading stale data. You might not care about this, but it is something to keep in mind.

With that said we do have a replica read api that I think was just added to the Couchbase 2.0 dp4. This api will allow you to read from a replica node, but I want to point out that the main use case here is for reading from a replica when the master node becomes unavailable eg. just before failover.

Let me know if you have any other questions about this.

[EDIT: replica read should also be part of 1.8.2]

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