0% found this document useful (0 votes)
137 views

Couchbase Server Basic Concepts

Couchbase Server is a distributed, multi-model NoSQL database that provides easy-to-scale key-value and JSON document access with low latency and high throughput. It is designed to be clustered from a single machine to large deployments across many machines, with features like automatic sharding, replication, and rebalancing.

Uploaded by

Mykaa Dba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views

Couchbase Server Basic Concepts

Couchbase Server is a distributed, multi-model NoSQL database that provides easy-to-scale key-value and JSON document access with low latency and high throughput. It is designed to be clustered from a single machine to large deployments across many machines, with features like automatic sharding, replication, and rebalancing.

Uploaded by

Mykaa Dba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

What is Couchbase Server?

Couchbase Server, originally known as Membase, is an open-source, distributed. Multi-model


NoSQL document-oriented database.
It is software package optimized for interactive applications.
These applications may serve many concurrent users by creating, storing, and retrieving,
aggregating, manipulating and presenting data.
Couchbase Server is designed to provide easy-to-scale key-value or JSON document access
with low latency and high sustained throughput. It is designed to be clustered from a single
machine to very large-scale deployments spanning many machines.

Couchbase Server provided client protocol compatibility with memcached, but added disk
persistence, data replication, live cluster reconfiguration, rebalancing and multitenancy with data
partitioning

What are the Main Features of Couchbase?


Flexible data model

With Couchbase Server, JSON documents are used to represent application objects
and the relationships between objects. This document model is flexible enough so that
you can change application objects without having to migrate the database schema, or
plan for significant application downtime. The other advantage of the flexible, document-
based data model is that it is well suited to representing real-world items.

JSON documents support nested structures, as well as fields representing relationships


between items which enable you to realistically represent objects in your application.

Easy scalability
It is easy to scale with Couchbase Server, both within a cluster of servers and between
clusters at different data centers. You can add additional instances of Couchbase
Server to address additional users and growth in application data without any
interruptions or changes in application code. With one click of a button, you can rapidly
grow your cluster of Couchbase Servers to handle additional workload and keep data
evenly distributed. Couchbase Server provides automatic sharding of data and
rebalancing at run time; this lets you resize your server cluster on demand.

Easy developer integration


Couchbase provides client libraries for different programming languages such as Java / .NET /
PHP / Ruby / C / Python / Node.js For read, Couchbase provides a key-based lookup
mechanism where the client is expected to provide the key, and only the server hosting the data
(with that key) will be contacted.

Consistent high performance


Couchbase Server is designed for massively concurrent data use and consistently high
throughput. It provides consistent sub-millisecond response times which help ensure an
enjoyable experience for application users. By providing consistent, high data
throughput, Couchbase Server enables you to support more users with fewer servers.
Couchbase also automatically spreads the workload across all servers to maintain
consistent performance and reduce bottlenecks at any given server in a cluster.

Reliable and secure


Couchbase support access control using username and passwords. The credentials are
transmitted securely over the network. The sensitive data can be protected while it is
transmitted to/from the client application.

There is no single point of failure, since the data can be replicated across multiple
nodes. Features such as cross-data center replication, failover, and backup and restore
help ensure availability of data during server or datacenter failure.

Couchbase Architecture
Couchbase is the merge of two popular NOSQL technologies:

 Membase, which provides persistence, replication, sharding to the high performance


memcached technology
 CouchDB, which pioneers the document oriented model based on JSON

Transaction Model
Similar too many NOSQL databases, Couchbase’s transaction model is primitive as compared
to RDBMS.

 Atomicity is guaranteed at a single document and transactions that span update of


multiple documents are unsupported.  To provide necessary isolation for concurrent
access, Couchbase provides a CAS (compare and swap) mechanism which works as
follows:

 When the client retrieves a document, a CAS ID (equivalent to a revision number) is


attached to it.
 While the client is manipulating the retrieved document locally, another client may
modify this document.  When this happens, the CAS ID of the document at the server
will be incremented.
 Now, when the original client submits its modification to the server, it can attach the
original CAS ID in its request.  The server will verify this ID with the actual ID in the
server.  If they differ, the document has been updated in between and the server will not
apply the update.
 The original client will re-read the document (which now has a newer ID) and re-submit
its modification.
 Couchbase also provides a locking mechanism for clients to coordinate their access to
documents.  Clients can request a LOCK on the document it intends to modify, update
the documents and then releases the LOCK.  To prevent a deadlock situation, each
LOCK grant has a timeout so it will automatically be released after a period of time.
Deployment Architecture
a Couchbase DB resides in a server clusters involving multiple machines.  Client library will
connect to the appropriate servers to access the data.  Each machine contains a number of
daemon processes which provides data access as well as management functions.
The data server, written in C/C++, is responsible to handle get/set/delete request from client. 
The Management server, written in Erlang, is responsible to handle the query traffic from client,
as well as manage the configuration and communicate with other member nodes in the cluster.
The data server, written in C/C++, is responsible to handle get/set/delete request from client. 
The Management server, written in Erlang, is responsible to handle the query traffic from client,
as well as manage the configuration and communicate with other member nodes in the cluster.

Virtual Buckets
The basic unit of data storage in Couchbase DB is a JSON document (or primitive data
type such as int and byte array) which is associated with a key.  The overall key space
is partitioned into 1024 logical storage unit called “virtual buckets” (or vBucket).  vBucket
are distributed across machines within the cluster via a map that is shared among
servers in the cluster as well as the client library.
High availability is achieved through data replication at the vBucket level.  Currently Couchbase
supports one active vBucket zero or more standby replicas hosted in other machines.  
Currently the standby server are idle and not serving any client request.  In future version of
Couchbase, the standby replica will be able to serve read request.
Load balancing in Couchbase is achieved as follows:

 When machines are added and removed in the cluster.  The administrator can request a
redistribution of vBucket so that data are evenly spread across physical machines.

Data Server
 Data server implements the memcached APIs such as get, set, delete, append,
prepend, etc. It contains the following key data structure:

You might also like