Developing with Couchbase Server

Book description

Today’s highly interactive websites pose a challenge for traditional SQL databases—the ability to scale rapidly and serve loads of concurrent users. With this concise guide, you’ll learn how to build web applications on top of Couchbase Server 2.0, a NoSQL database that can handle websites and social media where hundreds of thousands of users read and write large volumes of information.

Using food recipe information as examples, this book demonstrates how to take advantage of Couchbase’s document-oriented database design, and how to store and query data with various CRUD operations. Discover why Couchbase is better than SQL databases with memcached tiers for managing data from the most interactive portions of your application.

  • Learn about Couchbase Server’s cluster-based architecture and how it differs from SQL databases
  • Choose a client library for Java, .NET, Ruby, Python, PHP, or C, and connect to a cluster
  • Structure data in a variety of formats, from serialized objects, a stream of raw bytes, or as JSON documents
  • Learn core storage and retrieval methods, including document IDs, expiry times, and concurrent updates
  • Create views with map/reduce and learn Couchbase mechanisms for querying and selection

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Introduction
    2. Where to Get Help on Couchbase Server
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
    7. Acknowledgments
  2. 1. Couchbase Overview
    1. Architecture and Structure
    2. Buckets and vBuckets
    3. Data Storage and Retrieval
      1. Time to Live (TTL)
      2. Data Consistency
      3. Data Concurrency
    4. Views, Indexes, and Querying
    5. Comparing Couchbase to SQL Databases
    6. Use Cases
  3. 2. Getting Started
    1. Installing Couchbase Server
    2. Couchbase Client Libraries
      1. Java
      2. .NET
      3. Python
      4. Ruby
      5. PHP
    3. Buckets
    4. Connecting to a Cluster
  4. 3. Document-based Database Design
    1. JSON Overview
    2. Modeling Recipe Data
      1. Core Data
      2. Keywords or Tags
      3. Ingredients
      4. Methods
    3. Related Data
  5. 4. Getting Data In and Out
    1. Basic Interface
    2. Document Identifiers
    3. Time to Live (TTL)
    4. Storing Data
    5. Retrieving Data
      1. Retrieving in Bulk
    6. Updating Data
    7. Concurrent Updates
    8. Server-side Updates
    9. Asynchronous Operations
    10. Pessimistic Locking
    11. Deleting Data
  6. 5. Storing and Updating Recipes
    1. Initial Storage
    2. Editing
    3. Loading Recipe
    4. Storing Related Data
    5. Loading Related Data
    6. Documents Aren’t Everything
  7. 6. Views and Queries
    1. Creating Views on Your Data
      1. Maps, Reduce, Views, and Design Documents
      2. View Contents
    2. Accessing Views from a Client Library
    3. Querying and Selection
    4. Other Options
    5. Dealing with Different Document Formats
    6. View Values and Reduction
    7. Index Updates
      1. Stale Indexes and Updates
    8. Searching and Querying Examples
      1. Searching By Ingredient
      2. Searching by Recipe Time
      3. Searching by Ingredient and Time
    9. Reductions
      1. The Built-in _count Function
      2. The _sum Function
      3. The Built-in _stats Function
    10. Document Metadata
  8. 7. Next Steps
    1. Couchbase Server Resources
    2. Couchbase Developer Resources
  9. About the Author
  10. Colophon
  11. Copyright

Product information

  • Title: Developing with Couchbase Server
  • Author(s): MC Brown
  • Release date: February 2013
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449331160