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

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.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.