Client Deployment Strategies
Couchbase Server client SDKs are the preferred deployment option.
If your language and development environment supports a smart client library, Couchbase Server client SDKs are the preferred deployment option. If this is not the case, use the Couchbase Server client-side Moxi (Memcached Proxy) configuration for the best performance and functionality. If your existing application supports Memcached, Moxi can be deployed and facilitate use of a Couchbase Server cluster with all the power and functionality that Couchbase Server is known for.
Using a Couchbase Server Client SDK
When using an SDK, your application gains the ability to communicate directly to the Couchbase Server cluster nodes that are needed to perform the operation. Your application requires no knowledge of the cluster topology as the SDK takes care of this on your behalf.
The SDK communicates with the cluster using a custom Couchbase binary protocol. The protocol enables the SDK to receive a cluster topology map, locate the necessary service (Data, Index, Query) and node required for the operation, and then read/write information from there. For the Data service specifically, the SDK communicates directly to the vBucket (shard) that contains the data to perform the operation. When constructing the connection string on the client application for the SDK, it is the best practice to include at least three nodes from the cluster from which the initial cluster map originates. Any future changes to the cluster map following the initial bootstrap happen any time the cluster topology changes, for example during the cluster rebalance.
In releases prior to Couchbase Server 2.5, the SDK would make an HTTP connection to port 8091 to get the initial cluster map and any updates. With Couchbase Server 2.5 or later, the SDK gets the cluster map via the memcached protocol on port 11210 of a node (rather than via persistent HTTP connections to port 8091). Getting the map through the memcached protocol significantly improves connection scaling capabilities and reduces the number of open ports.
Client-Side Memcached to Couchbase Proxy
- A client SDK is not available for your chosen platform.
- Your application is already using Memcached, and you are not ready for an application redesign.
Your application should be configured to communicate via your memcached library to just one server in its server list (localhost). All application operations are sent to localhost:11211, which is the port serviced by Moxi.
- Hashes the document ID to the vBucket in the Data Service.
- Looks up the host server for that vBucket in the cluster map.
- Sends the operation to the appropriate cluster node on port 11210 to fulfill the operation.