Preface - Couchbase Essentials (2015)

Couchbase Essentials (2015)

Preface

Not too long ago, I was fortunate enough to have worked for Couchbase Inc. with the developer solutions team. In my role as a developer advocate, I had two primary responsibilities: maintaining the Couchbase .NET SDK and training Couchbase users on how to develop for Couchbase Server.

During my tenure on the SDK team, I worked with hundreds of developers around the world who were using Couchbase Server for a wide variety of solutions. Some were using Couchbase Server for its distributed caching abilities, while others needed a model that could support near-real-time analytics over a flexible schema. I was always impressed with Couchbase Server's ability to handle such a vast number of development scenarios.

Through the countless meetings I had with the development community and customers alike, it became clear to me that NoSQL is far from a technology fad. Along with cloud computing and mobile services, NoSQL has become a part of the fabric from which modern applications are woven.

As with relational databases before them, NoSQL databases such as Couchbase Server are quickly nearing the "required knowledge" status for application developers. Modern applications that need to reach a massive scale or require greater data model flexibility have found success with non-relational systems.

It is a tremendous opportunity to be able to share my experience at Couchbase with you, the reader. This is an exciting technology, and this book contains the tools you need to get started with Couchbase development.

What this book covers

Chapter 1, Getting Comfortable with Couchbase, introduces Couchbase Server and provides details on obtaining and installing it. It also walks you through setting up Couchbase Server for the first time.

Chapter 2, Using Couchbase CRUD Operations, provides an overview of basic Couchbase Server operations. Basic SDK usage is demonstrated while exploring the various CRUD API methods.

Chapter 3, Creating Secondary Indexes with Views, explains in detail the programming model of MapReduce. After this exploration, the basics of using MapReduce within Couchbase Server are explored.

Chapter 4, Advanced Views, explores common view patterns for Couchbase development, following on the previous chapter's discussion of MapReduce.

Chapter 5, Introducing N1QL, introduces the prerelease Couchbase query language, N1QL.

Chapter 6, Designing a Schema-less Data Model, discusses many of the design options that must be considered when building Couchbase Server applications. Both key/value and document schemas are covered.

Chapter 7, Creating a To-do App with Couchbase, provides an overview on how to convert Couchbase Server to a basic to-do application.

Appendix, Couchbase SDKs, contains a brief introduction to the official Couchbase SDKs, including installation and basic usage.

What you need for this book

In order to follow along with the examples in this book, you will need to install Couchbase Server 3.0.x. Installer packages are available for Windows, Mac OS X, and multiple Linux distributions. Couchbase Server comes in both Community and Enterprise editions, and either will work.

The SDK examples shown in this book mostly use the .NET and Couchbase Server SDKs, though any SDK can be used. To try out the SDK samples, you will need to have a development environment for your chosen language and the SDK itself. Details on where to obtain and install both the server and the clients are provided early in the book.

Who this book is for

This book is for those application developers who want greater flexibility and scalability for their software. Whether you are familiar with other NoSQL databases or have used only relational systems, this book will provide you with enough background for you to proceed at your own pace. If you are new to NoSQL document databases, the design discussions and introductory material will give you the information you need to get started with Couchbase.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and explanations of their meanings.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "To update an existing document, we use the replace operation."

A block of code is set as follows:

function(doc, meta) {

emit(meta.id, null);

}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

function(doc, meta) {

if (doc.type == "beer") {

emit(null, null);

}

}

Any command-line input or output is written as follows:

./cbq-engine–couchbase http://localhost:8091

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Brewery documents in the beer-sample bucket contain address information."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.