Migrating from Membase

Migration guidelines for Membase users

For an existing Membase user, the primary methods for creating, adding, manipulating, and retrieving data remain the same. In addition, the background operational elements of Couchbase Server deployment will not differ from the basic running of a Membase cluster.

Term and concept differences

The following terms are new or updated in Couchbase Server:

* `Views`, and the associated terms of the `map` and `reduce` functions used to
  define views. Views provide an alternative method for accessing and querying
  information stored in key-value pairs within Couchbase Server. Views allow you
  to query and retrieve information based on the values of the contents of a
  key-value pair, providing the information has been stored in JSON format.

* *JSON (JavaScript Object Notation)*, a data representation format that is
  required to store the information in a format that can be parsed by the View
  system is new.

* *Membase Server* is now *Couchbase Server*.

* *Membase Buckets* are now *Couchbase Buckets*.

Consistent functionality

The core functionality of Membase, including the methods for basic creation, updating, and retrieval of information all remain identical within Couchbase Server. You can continue to use the same client protocols for setting and retrieving information.

The administration, deployment, and core of the Couchbase Web Console and administration interfaces are also identical. There are updates and improvements to support additional functionality which is included in existing tools. These include views-related statistics, and an update to the Web Administration Console for building and defining views.

Changed functionality

The main difference available in the Couchbase Server is that in addition to the key-value data store nature of the database, you can also use views to convert the information from individual objects in your database into lists or tables of records and information. Through the view system, you can also query data from the database based on the value (or fragment of a value) of the information that you have stored against a key.

This fundamental differences means that applications no longer need to manually manage the concept of lists or sets of data by using other keys as a lookup or compounding values.

Operational and deployment differences

The main components of the operation and deployment of your Couchbase Server remain the same as with Membase Server. You can add new nodes, fail over, rebalance and otherwise manage your nodes.

However, the introduction of views means that you need to monitor and control the design documents and views that are created alongside your bucket configurations. Indexes are generated for each design document (that is multiple views), and for optimum reliability you might want to back up the generated index information to reduce the time to bring up a node in the event of a failure, as building a view from raw data on large datasets can take a significant amount of time.

In addition, you need to understand how to recreate and rebuild view data, and how to compact and clean up view information to help reduce disk space consumption and response times.

Client and application changes

Clients can continue to communicate with Couchbase Server using the existing memcached protocol interface for the basic create, retrieve, update and delete operations for key-value pairs. However, to access the view functionality you must use a client library that supports the view API (which uses HTTP REST).

To build views that can output and query your stored data, your objects must be stored in the database using the JSON format. If you have been using the native serialization of your client library to convert a language specific object so that it can be stored into Membase Server, you might need to structure your data and use a native to JSON serialization solution, or reformat your data so that it can be formatted as JSON.