Search:

Search all manuals
Search this manual
Manual
Membase Manual 1.7
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
Membase Manual 1.7
Child Sections
Chapters

Chapter 5. Membase Architecture

Table of Contents

5. Cluster Design
5. Persistence Design
5. Component Overview
5.1. Growing Data Sets Beyond Memory
5.1. Design
5.1. Consequences of Memory faster than Disk
5.1.1. DGM Implementation Details
5.2. Membase APIs
5.2.1. memcached protocol
5.3. Additional Protocol Operations
5.3. TAP Protocol
5.3. Other Extensions
5.3.1. getl extended operations
5.4. vBuckets
5.4. Membase Key-vBucket-Server Mapping Illustrated
5.4. vBuckets in a world of OTC memcached clients
5.4. Deployment Option 1 - Using Membase Embedded Proxy
5.4. Deployment Option 2 - Standalone Proxy
5.4. Deployment Option 3 - "vBucket aware" client
5.5. Failover with Membase
5.5. When and how should I use failover?
5.5.1. Automatic Failover
5.5.2. Automated failover considerations
5.5.3. Monitored failover
5.6. Membase Buckets

From a client perspective, membase speaks memcached protocol, which is well understood by many, if not most application developers. The difference, of course, is that membase has persistence and replication capabilities while still allowing for memcached like speed.

Cluster Design

Individual membase nodes are clustered together. Within a cluster data is automatically replicated between nodes of a cluster. Cluster nodes can be added and removed without interrupting access to data within the cluster.

All clusters start with a single node, typically one installed from a package. Either through the Web UI or from the REST interface, membase allows one or more nodes to be added to the cluster. When a node is added to the cluster, it does not immediately start performing data operations. This is to allow the user to perform one or more changes to the cluster before initiating a rebalance. During a rebalance the data and replicas of that data, contained in sub-partitions of the cluster called vbuckets, are redistributed throughout the cluster. By design, a given vbucket is only active in one place within the cluster at a given point in time. By doing so, membase is always consistent for any given item.

Data is moved between nodes, both when rebalancing and replicating, using a set of managed vbucketmigrator processes in the cluster. This process uses a new protocol called TAP. TAP is generic in nature though, and it has very clear use cases outside replication or migration of data. Incidentally, TAP doesn't actually stand for anything. The name came about when thinking about how to "tap into" a membase node. This could be thought of along the lines of a 'wiretap' or tapping into a keg.

Cluster replication defaults to asynchronous, but is designed to be synchronous. The benefit of replication being asynchronous is that membase has speeds similar to memcached in the default case, taking a data safety risk for a short interval.

Cluster coordination and communication is handled by the ns_server erlang process. Generally, users of membase need not be aware of the details about how ns_server performs its tasks, as interfacing with the cluster is done with the aforementioned membase REST interface. As part of keeping the system simple, all nodes of the cluster expose the state of the cluster.

Persistence Design

Generally speaking, membase is memory oriented, by which we mean that it tends to be designed around the working set being resident in memory, as is the case with most highly interactive web applications. However, the set of data in memory at any given point in time is only the hot data. Data is persisted to disk by membase asynchronously, based on rules in the system.

Component Overview

From a developer perspective, it is useful to know how all of the components of membase come together. A membase node consists of