November 2015
Beginner to intermediate
248 pages
5h 24m
English
By now, you have understood how to connect to the bucket and perform various operations using the Java SDK. We can conclude that there are two ways of connecting to the bucket:
Cluster cluster = CouchbaseCluster.create(); Bucket bucket = cluster.openBucket();
AsyncBucket asyncBucket = bucket.async();
It's best practice to create one instance of CouchbaseCluster per application.
Couchbase SDKs based on Java and .Net are designed to be thread-safe for each operation. There is a class called CouchbaseEnvironment that can be used to customize connection to the cluster.
How we create this environment is given in the following code:
CouchbaseEnvironment clusterEnv = DefaultCouchbaseEnvironment .builder() ...
Read now
Unlock full access