Search:

Search all manuals
Search this manual
Manual
Couchbase Developer's Guide 2.0
Community Wiki and Resources
Download Couchbase Server 2.0
Couchbase Server 2.0 Manual
Client Libraries
Couchbase Server Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
Couchbase Developer's Guide 2.0
Child Sections
Chapters

Chapter 2. Modeling Documents

Table of Contents

2.1. Comparing Document-Oriented and Relational Data
2.2. Using JSON Documents
2.3. Schema-less Data Modeling
2.4. Document Design Considerations
2.5. Modeling Documents for Retrieval
2.6. Using Reference Documents for Lookups
2.7. Sample Storage Documents

This section describes core elements you will use to handle data in Couchbase Server; it will describe the ways you can structure individual JSON documents for your application, how to store the documents from a Couchbase SDK, and describe different approaches you may take when you structure data in documents.

Couchbase Server is a document database; unlike traditional relational databases, you store information in documents rather than table rows. Couchbase has a much more flexible data format; documents generally contains all the information about a data entity, including compound data rather than the data being normalized across tables.

A document is a JSON object consisting of a number of key-value pairs that you define. There is no schema in Couchbase; every JSON document can have its own individual set of keys, although you may probably adopt one or more informal schemas for your data.

As of Couchbase Server 2.0, one of the benefits of using JSON documents is that you can index and query these records. This enables you to collect and retrieve information based on rules you specify about given fields; it also enables you to retrieve records without using the key for the record. For more information about indexing and querying using Couchbase SDK, see Chapter 4, Finding Data with Views.