Databases Reference
In-Depth Information
which is backed up by disk and configured with replication. A Couchbase JSON docu-
ment is written to one or more disks. For our discussions on high-availability systems,
we'll focus on Couchbase buckets.
Internally, Couchbase uses a concept called a vBucket (virtual bucket) that's associ-
ated with one or more portions of a hash-partitioned keyspace. Couchbase keyspaces
are similar to those found in Cassandra, but Couchbase keyspace management is done
transparently when items are stored. Note that a vBucket isn't a single range in a key-
space; it may contain many noncontiguous ranges in keyspaces. Thankfully, users
don't need to worry about managing keyspaces or how vBuckets work. Couchbase cli-
ents simply work with buckets and let Couchbase worry about what node will be used
to find the data in a bucket. Separating buckets from vBuckets is one of the primary
ways that Couchbase achieves horizontal scalability.
Using information in the cluster map, Couchbase stores data on a primary node as
well as a replica node. If any node in a Couchbase cluster fails, the node will be
marked with a failover status and the cluster maps will all be updated. All data requests
to the node will automatically be redirected to replica nodes.
After a node fails and replicas have been promoted, users will typically initiate a
rebalance operation to add new nodes to the cluster to restore the full capacity of the
cluster. Rebalancing effectively changes the mapping of vBuckets to nodes. During a
rebalance operation, vBuckets are evenly redistributed between nodes in the cluster
to minimize data movement. Once a vBucket has been re-created on the new node,
it'll be automatically disabled on the original node and enabled on the new node.
These functions all happen without any interruption of services.
Couchbase has features to allow a Couchbase cluster to run without interruption
even if an entire data center fails. For systems that span multiple data centers, Couch-
base uses cross data center replication ( XDCR ) , which allows data to automatically be repli-
cated between remote data centers and still be active in both data centers. If one data
center becomes unavailable, the other data center can pick up the load to provide
continuous service.
One of the greatest strengths of Couchbase is the built-in, high-precision monitor-
ing tools. Figure 8.8 shows a sample of these monitoring tools.
These fine-grained monitoring tools allow you to quickly locate bottlenecks in
Couchbase and rebalance memory and server resources based on your loads. These
tools eliminate the need to purchase third-party memory monitoring tools or config-
ure external monitoring frameworks. Although it takes some training to understand
how to use these monitoring tools, they're the first line of defense when keeping your
Couchbase clusters healthy.
Couchbase also has features that allow software to be upgraded without an inter-
ruption in service. This process involves replication of data to a new node that has a
new version of software and then cutting over to that new node. These features allow
you to provide a 24/365 service level to your users without downtime.
Search WWH ::




Custom Search