Connection Pooling

August 7, 2013

Multiple Bucket Connections in Couchbase and Ruby

c = Couchbase.new("http://localhost:8091/pools/default/buckets/my-bucket")

I believe it’s safe to say we are mostly all familiar with the above Ruby code.  It establishes a connection from the Ruby SDK to a bucket of our choosing inside our Couchbase cluster.  There are, of course, multiple ways of writing this line, such as specifying the URI and Port as Ruby Symbols (:pool => "default", :bucket => "my-bucket")etc.  The point I am making here is that we write these simple one line commands, and get 1 simple connection to our chosen bucket.  But what if our application uses multiple buckets? In this article, I’m going to back to basics, and take you through setting up, and connecting to Multiple Buckets.

Read more »