Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 2.0
Community Wiki and Resources
Download Couchbase Server 2.0
Couchbase Developer Guide 2.0
Client Libraries
Couchbase Server Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
9.3 Views and Stored Data
Chapter Sections
Chapters

9.3.4. Document Storage and Indexing Sequence

The method of storage of information into the Couchbase Server affects how and when the indexing information is built, and when data written to the cluster is incorporated into the indexes. In addition, the indexing of data is also affected by the view system and the settings used when the view is accessed.

The basic storage and indexing sequence is:

  1. A document is stored within the cluster. Initially the document is stored only in RAM.

  2. The document is persisted to disk through the standard disk write queue mechanism.

  3. Once the document has been persisted to disk, the document can be indexed by the view mechanism.

This sequence means that the view results are eventually consistent with what is stored in memory based on whether documents have been persisted to disk. It is possible to write a document to the cluster, and access the index, without the newly written document appearing in the generated view index.

Conversely, documents that have been stored with an expiry may continue to be included within the view index until the document has been removed from the database by the expiry pager.

Note

Couchbase Server supports the Observe command, which enables the current state of a document and whether the document has been persisted to disk and/or whether it has been considered for inclusion in an index.

When accessing a view, the contents of the view are asynchronous to the stored documents. In addition, the creation and updating of the view is subject to the stale parameter. This controls how and when the view is updated when the view content is queried. For more information, see Section 9.2.4, “Index Updates and the stale Parameter”. Views can also be automatically updated on a schedule so that their data is not too out of sync with stored documents. For more information, see Section 9.2.5, “Automated Index Updates”.