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

creating a connection to a couchbase server,

1 reply [Last post]
  • Login or register to post comments
Sat, 10/06/2012 - 09:52
soroushatarod
Offline
Joined: 09/27/2012
Groups: None

I have few questions regarding the php documentation:

1) what does $object->getMultiByKey($master_key, $keyn [, $cas_token ] [, $flags ]) , mean?

-$master_key Master key used for consistent server references , Does it mean array of servers?

2) Assuming I have 3 servers, should I make a connection to one only:
$cb = new Couchbase("192.168.1.200:8091", "user", "pass");

or $hosts = array(
"server1",
"server2",
"server3"
);

3) If I have 3servers, and I always create a connection to one, wouldn't it cause a slight delay? Since, everytime it connects, it gets the location and server link, from vbucket and then fetches the result from the server that has the data? . Is there a way that it randomly connects to a particular server thus reducing the load of creating a connection on one server!

Top
  • Login or register to post comments
Thu, 10/11/2012 - 04:23
daschl
Offline
Joined: 05/19/2012
Groups: None

Hi,

first to your connection question:

You can pass either a String (more nodes delimited with ";") or an array to the constructor. This is only supported in 1.1 (I _think_ the ";" delimiter works in 1.0 too but I'm not 100% sure).

At this point, this list is used to find a live node in your cluster and start talking to it. When it finds one, it - behind the scenes - throws away your information and updates it with the latest one provided from the cluster. This means in practice that your list is only needed during the bootstrap-phase. This has the big advantage that changes to the cluster during runtime are taken into account.

ad 1)
I'm not aware of a getMultiByKey operation, I guess you mean getMulti? Maybe its outdated documentation. For some examples on getMulti, look at the following tests: https://github.com/couchbase/php-ext-couchbase/blob/master/tests/GetMult...

Best,
Michael

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