DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Couchbase


Couchbase-Server is an opensource, distributed (shared-nothing) NoSQL document-oriented databse. It is desgined for interactive applications involving multiple users and concurrency operations. Couchbase server provides key-value or JSON document access scaled from one single machine to multiple machines. Couchbase server supports the Memcached client protocol and provides extra features like disk persistence, data replication, live cluster reconfiguration, rebalancing and multi-tenancy with data partitioning.[04]

Source Code
https://github.com/couchbase/manifest[02]
Developer
Country of Origin
US
Start Year
2010 [21]
Former Name
Membase
Project Types
Commercial, Open Source
Written in
C, C++, Erlang, Go
Supported Languages
C, C#, Go, Java, JavaScript, PHP, Python
Derived From
CouchDB
Compatible With
Memcached
Operating Systems
Linux, macOS, Windows
License
Apache v2

Database Entry

Couchbase


Couchbase-Server is an opensource, distributed (shared-nothing) NoSQL document-oriented databse. It is desgined for interactive applications involving multiple users and concurrency operations. Couchbase server provides key-value or JSON document access scaled from one single machine to multiple machines. Couchbase server supports the Memcached client protocol and provides extra features like disk persistence, data replication, live cluster reconfiguration, rebalancing and multi-tenancy with data partitioning.[04]

History[04]


In 2010, the origination of Couchbase, Membase, was developed by a company called NorthScale which was founded by developers from Memcached project.

In February, 2011, the Membase project founders and Membase, Inc. merged with CouchOne(a company with many engineers behind CouchDB) as a new company called Couchbase, Inc.

In January 2012, Couchbase Server 1.8 was released and 1.8 was the first version after rename from Membase.

In December 2012, CouchBase Server 2.0 was released. New features like JSON new document store, indexing and querying, incremental MapReduce and replication across data centers are added.

Checkpoints[05]


The replicator of Couchbase Server will checkpoint the source sequenceID corresponding to the last change sent to the target with a conflict resolver.

Compression[03]


Couchbase Server (Enterprise Edition) applies data compression to documents with open-source library Snappy. It provides three modes of compression.

  • Off. The Couchbase Server decompresses the document if it is compressed, and stores the uncompressed document in memory but recompresses it when storing on disk. Couchbase server sends the document in uncompressed form.

  • Passive. When Couchbase Server receives the compressed document, it stores the compressed document in memory and disk. Also, the documents are sent in compressed form.

  • Active. Couchbase Server stores and sends compressed document even the document is uncompressed when it was received.

Concurrency Control[06]


Couchbase Server offers both optimistic and pessimistic locking to guarantee concurrency.

Data Model[07]


The documents stored in Couchbase Server are in JSON or binary format.

Hardware Acceleration[08]


Not Supported

Indexes[09][10]


A few of indexes are available in Couchbase Server:

  • Primary Index is based on on the unique key of every item in a specified bucket which contains a full set of keys in a given key space.

  • Global Secondary Index (GSI) is the most frequently used index in Couchbase Server, for queries performed with the N1Ql query-language.
    The indexer for GSI creates a B+ tree for fast scans on the index key. Also, there is a Memory-Optimized GSI index which uses the skip-list structure as opposed to B-tree indexes.

  • Full Text is provided by the Search Service and it contains targets derived from the textual contents of documents within one or more specified buckets.

  • View: Supports Couchbase Views, with fields and information extracted from documents.

Isolation Levels[11]


Couchbase Server provides read committed isolation by default at the single document level. However, using the provided optimistic locking and pessimistic locking, user can obtain isolation of an individual document, to make sure that changes happen in the order that you expect.

Joins[12]


Couchbase Server supports lookup join, index join and ANSI join in its N1QL language.

Logging


Query Compilation


Query Interface[13]


Couchbase Server uses a new language called N1QL which is a SQL for JSON for the query interface.

Storage Architecture[14]


Couchbase Server maintains recent accessed data in the memory to achieve high performance and scalability. The data which is not recently used will be swapped on to disks.

Storage Model[15][16]


Couchbase Server stores items in the Buckets. There are two kinds of Buckets in the Couchbase. One is Couchbase Buckets which could reside both in memory and disks. Another is Ephemeral buckets which only stay in the memory.

Storage Organization[16]


Couchbase Server uses Couchstore to store core data operations. Each vBucket is represented as a separate Couchstore file in the file system. Couchstore uses a B+tree structure to quickly access items through their keys. Couchstore uses an append-only write model for efficient and safe writes.

Stored Procedures[17]


A similar feature called "Prepared queries" is supported in Couchbase Server.

System Architecture[18]


Each machine running Couchbase server is a single node, and multiple nodes could join together as a cluster. Data and services are distributed and shared in the cluster. Every node of the cluster has a Cluster Manager for communication. The data inside the cluster is evenly distributed and replicated over the nodes.

Views[19][20]


Three views are supported by Couchbase Server: MapReduce views, Spatial views and Global Secondary Indexes (GSI) views.

  • MapReduce views can be accessed via the View API.

  • Spatial views can be accessed via the Spatial View API.

  • N1QL queries with Global Secondary Indexes (GSI) and MapReduce views.

Citations

21 sources
  1. Couchbase | Home couchbase.com
  2. GitHub - couchbase/manifest: Top-level source repository for Couchbase Server source code and build projects · GitHub github.com
  3. Couchbase Documentation | Couchbase Docs couchbase.com
  4. Couchbase Server - Wikipedia wikipedia.org
  5. https://blog.couchbase.com/data-replication-couchbase-mobile couchbase.com Dead — Check Archive
  6. Data | Couchbase Docs couchbase.com
  7. The Couchbase Data Model | Couchbase Docs couchbase.com Dead — Check Archive
  8. System Resource Requirements | Couchbase Docs couchbase.com
  9. Indexes | Couchbase Docs couchbase.com
  10. Primary and Secondary Index Reference | Couchbase Docs couchbase.com
  11. https://blog.couchbase.com/acid-properties-couchbase-part-1 couchbase.com Dead — Check Archive
  12. https://blog.couchbase.com/ansi-join-support-n1ql couchbase.com Dead — Check Archive
  13. SQL++ for Query Reference | Couchbase Docs couchbase.com
  14. Buckets, Memory, and Storage | Couchbase Docs couchbase.com
  15. Buckets | Couchbase Docs couchbase.com
  16. Storage Properties | Couchbase Docs couchbase.com
  17. https://www.couchbase.com/forums/t/stored-procedures-in-n1ql/3551/7 couchbase.com Dead — Check Archive
  18. Clusters and Availability | Couchbase Docs couchbase.com
  19. Index Service | Couchbase Docs couchbase.com
  20. https://developer.couchbase.com/documentation/server/3.x/admin/Views/views-writing.html couchbase.com Dead — Check Archive
  21. NoSQL Companies CouchOne And Membase Merge To Form Couchbase | TechCrunch techcrunch.com
Revision #10