Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Up
1.3 Architecture and Concepts
Section Navigation
Chapter Navigation

1.3.6. Disk Storage

For performance, Couchbase Server prefers to store and provide all the information to clients using RAM. However, this is not always possible or desirable in an application. Instead, what is required is the 'working set' of information stored in RAM and immediately available for supporting low-latency responses.

Couchbase Server provides support for storing document on disk. This is provided for a number of reasons:

The process of moving data from RAM to disk is called eviction, and is configured automatically through thresholds set on each configured bucket in your Couchbase Cluster.

The use of disk storage presents an issue in that a client request for a document ID must know whether the information exists or not. Couchbase Server achieves this using metadata structures. The metadata holds information about each documents stored in the database and this information is held in RAM. This means that the server can always return a 'document ID not found' response for an invalid document ID, while waiting (and returning) the data for an item either in RAM (in which case it is returned immediately), or after the item has been read from disk (after a delay, or until a timeout has been reached).

The process of moving information to and from disk is asynchronous. Data is evicted to disk from memory in the background while the server continues to service active requests. Eviction requests are written to an eviction queue to be written to disk in the background. During sequences of high writes to the database, clients will be notified that the server is temporarily out of memory until enough items have been evicted from memory to disk.

Similarly, when the server identifies an item that needs to be loaded from disk because it is not in active memory, the process is handled by a background process that processes the load queue and reads the information back disk and into memory. The client is made to wait until the data has been loaded back into memory before the information is returned.

The asynchronous nature and use of queues in this way enables reads and writes to be handled at a very fast rate, while removing the typical load and performance spikes that would otherwise cause a server running Couchbase Server to produce erratic performance.

blog comments powered by Disqus