Book Image

Couchbase Essentials

Book Image

Couchbase Essentials

Overview of this book

Table of Contents (15 chapters)
Couchbase Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 1. Getting Comfortable with Couchbase

Couchbase Server has quickly emerged as one of the leading NoSQL databases. Known for powering apps and sites such as Viber, PayPal, LinkedIn, and eBay, Couchbase Server easily serves up terabytes to petabytes of data. Whether used as a distributed cache or a document database, Couchbase Server has become a significant contributor to the growth of the Internet as a whole.

Long before the term NoSQL started to grace the pages of blogs, tech journals, and investor balance sheets, a technology called Memcached was providing life support for relational databases. As these systems attempted to reach the scale demanded by modern, Internet-based applications, it was clear that Memcached could help. Still widely used today, Memcached is a distributed key/value store used to provide a caching layer for applications.

Some of the developers on the open source Memcached project saw the potential to take the system beyond a simple cache. They introduced new features such as a binary protocol, better cluster management, and most importantly, persistence. This new and durable offshoot of Memcached became known as Membase. A company of the same name was formed to support the project (it is still open source) and provide customers with support in their production environments.

Membase quickly gained popularity with developers who needed massive scalability. From start-ups to stalwarts, this new database was becoming one of the disruptive technologies that would forever change the way applications store data. Around the same time, developers were starting to demand more flexibility from their databases. A seemingly infinite number of web applications were built using Object Relational Mappers (ORM) such as ActiveRecord, Hibernate, and SQLAlchemy.

ORMs attempt to simplify the object-to-relational mapping problems often associated with working with a highly normalized database. The basic problem is that the relational model does not always look like an object-oriented model. ORMs hide the underlying data model from the application layer, often by way of a significant amount of configuration. ORMs also provide relational databases with a new lifeline.

One open source project that attempted to solve the object-to-relational mapping problem by doing away with the relational side of things was CouchDB. The developers of CouchDB built a database that, in their own words, was for developers and by developers. Tables, columns, and rows were replaced by documents stored as JSON. The net result was a system that stored data in structures similar to those found in the application layer.

Eventually, as both Membase and CouchDB matured, the developers of both systems came together for what is one of the most important chocolate-meets-peanut-butter moments in database history. The extremely scalable and reliable Membase would eventually be married to the ever-flexible and developer-friendly CouchDB. Each database would take part of its maiden name in the merger, which was called Couchbase.

Today, Couchbase is responsible for developing and supporting Couchbase Server. The combined products still remain open source but are no longer tied to their parent projects. While many of the features of Couchbase were inspired by CouchDB and Memcached, the code is anything but a "copy-and-paste" from the parent projects. Make no mistake about it! Couchbase is a standalone product optimized to be better than two otherwise great projects.