Connection pooling in Couchbase SDK (spymemcached)
We are in process of evaluating couchbase. Following are the list of questions with reference to couchbase.
1) Does the couchbase client has internal connection pooling concept ? If yes, how can we tune the connection pool ? If not, can someone provide a sample code to develop connection pooling ?
2) It is mentioned that CouchbaseClient is thread-safe.
How many concurrent thread it can serve ? What is the upper limit for thread pool for accessing the client object concurrently ?
Couchbase SDKs are thread safe and for Java and .Net, you can use without developing your own pool.
In Java, just create a singleton that initialize the connection to the cluster at startup then get the connection whenever you need it.
You can take a look to the BeerSample Application :
See the ServletContextListener:
And how to get a connection for example in a servlet:
Connection pooling is not required. You can tune some of the parameters in the Couchbase connection, however,
via the CouchbaseConnectionFactoryBuilder class. Please refer to
Yes, the CouchbaseClient is thread safe. There is no upper limit from a Couchbase connection perspective.