Software:Couchbase Server

From HandWiki
Short description: Open-source NoSQL database
Couchbase Server
CouchbaseLogo.svg
Couchbase Server Screenshot
Developer(s)Couchbase, Inc.
Initial releaseAugust 2010 (2010-08)
Stable release
7.2.1 / September 14, 2023 (2023-09-14)
Written inC++, Erlang, C,[1] Go, Java
TypeMulti-model database, distributed key-value database, document-oriented database, JSON database
LicenseBSL 1.1,[2] freemium
Websitewww.couchbase.com
Couchbase at AWS Summit

Couchbase Server, originally known as Membase, is a source-available,[2] distributed (shared-nothing architecture) multi-model NoSQL document-oriented database software package optimized for interactive applications. These applications may serve many concurrent users by creating, storing, retrieving, aggregating, manipulating and presenting data. In support of these kinds of application needs, Couchbase Server is designed to provide easy-to-scale key-value, or JSON document access, with low latency and high sustainability throughput. It is designed to be clustered from a single machine to very large-scale deployments spanning many machines.

Couchbase Server provided client protocol compatibility with memcached,[3] but added disk persistence, data replication, live cluster reconfiguration, rebalancing and multitenancy with data partitioning.

Product history

Membase was developed by several leaders of the memcached project, who had founded a company, NorthScale, to develop a key-value store with the simplicity, speed, and scalability of memcached, but also the storage, persistence and querying capabilities of a database. The original membase source code was contributed by NorthScale, and project co-sponsors Zynga and Naver Corporation (then known as NHN) to a new project on membase.org in June 2010.[4]

On February 8, 2011, the Membase project founders and Membase, Inc. announced a merger with CouchOne (a company with many of the principal players behind CouchDB) with an associated project merger. The merged company was called Couchbase, Inc. In January 2012, Couchbase released Couchbase Server 1.8. In September of 2012, Orbitz said it had changed some of its systems to use Couchbase.[5] In December of 2012, Couchbase Server 2.0 (announced in July 2011) was released and included a new JSON document store, indexing and querying, incremental MapReduce and replication across data centers.[6][7]

Architecture

Every Couchbase node consists of a data service, index service, query service, and cluster manager component. Starting with the 4.0 release, the three services can be distributed to run on separate nodes of the cluster if needed. In the parlance of Eric Brewer's CAP theorem, Couchbase is normally a CP type system meaning it provides consistency and partition tolerance, or it can be set up as an AP system with multiple clusters.

Cluster manager

The cluster manager supervises the configuration and behavior of all the servers in a Couchbase cluster. It configures and supervises inter-node behavior like managing replication streams and re-balancing operations. It also provides metric aggregation and consensus functions for the cluster, and a RESTful cluster management interface. The cluster manager uses the Erlang programming language and the Open Telecom Platform.

Replication and fail-over

Data replication within the nodes of a cluster can be controlled with several parameters. In December of 2012, support was added for replication between different data centers.[6]

Data manager

The data manager stores and retrieves documents in response to data operations from applications. It asynchronously writes data to disk after acknowledging to the client. In version 1.7 and later, applications can optionally ensure data is written to more than one server or to disk before acknowledging a write to the client. Parameters define item ages that affect when data is persisted, and how max memory and migration from main-memory to disk is handled. It supports working sets greater than a memory quota per "node" or "bucket". External systems can subscribe to filtered data streams, supporting, for example, full text search indexing, data analytics or archiving.[8]

Data format

A document is the most basic unit of data manipulation in Couchbase Server. Documents are stored in JSON document format with no predefined schemas. Non-JSON documents can also be stored in Couchbase Server (binary, serialized values, XML, etc.)

Object-managed cache

Couchbase Server includes a built-in multi-threaded object-managed cache that implements memcached compatible APIs such as get, set, delete, append, prepend etc.

Storage engine

Couchbase Server has a tail-append storage design that is immune to data corruption, OOM killers or sudden loss of power. Data is written to the data file in an append-only manner, which enables Couchbase to do mostly sequential writes for update, and provide an optimized access patterns for disk I/O.

Performance

A performance benchmark done by Altoros in 2012, compared Couchbase Server with other technologies.[9] Cisco Systems published a benchmark that measured the latency and throughput of Couchbase Server with a mixed workload in 2012.[10]

Licensing and support

Couchbase Server is a packaged version of Couchbase's open source software technology and is available in a community edition without recent bug fixes with an Apache 2.0 license[11] and an edition for commercial use.[12] Couchbase Server builds are available for Ubuntu, Debian, Red Hat, SUSE, Oracle Linux, Microsoft Windows and macOS operating systems.

Couchbase has supported software developers' kits for the programming languages .NET, PHP, Ruby, Python, C, Node.js, Java, Go, and Scala.

SQL++

A query language called SQL++ (formerly called N1QL), is used for manipulating the JSON data in Couchbase, just like SQL manipulates data in RDBMS. It has SELECT, INSERT, UPDATE, DELETE, MERGE statements to operate on JSON data. It was initially announced in March 2015 as "SQL for documents".[13]

The SQL++ data model is non-first normal form (N1NF) with support for nested attributes and domain-oriented normalization. The SQL++ data model is also a proper superset and generalization of the relational model.

Example

{
  "email": "testme@example.org",
  "friends": [
    { "name": "Pavan" },
    { "name": "Ravi" }
  ]
}
Like query
SELECT * FROM `bucket` WHERE email LIKE "%@example.org";
Array query
SELECT * FROM `bucket` WHERE ANY x IN friends SATISFIES x.name = "Pavan" END;

Couchbase Mobile

Couchbase Mobile / Couchbase Lite is a mobile database providing data replication.[14]

Couchbase Lite (originally TouchDB) provides native libraries for offline-first NoSQL databases with built-in peer-to-peer or client-server replication mechanisms.[15] Sync Gateway manages secure access and synchronization of data between Couchbase Lite and Couchbase Server.[16]

Uses

Couchbase began as an evolution of Memcached, a high-speed data cache, and can be used as a drop-in replacement for Memcached, providing high availability for memcached application without code changes.[17]

Couchbase is used to support applications where a flexible data model, easy scalability, and consistent high performance are required, such as tracking real-time user activity or providing a store of user preferences or online applications.[18]

Couchbase Mobile, which stores data locally on devices (usually mobile devices) is used to create “offline-first” applications that can operate when a device is not connected to a network and synchronize with Couchbase Server once a network connection is re-established.[19]

The Catalyst Lab at Northwestern University uses Couchbase Mobile to support the Evo application, a healthy lifestyle research program where data is used to help participants improve dietary quality, physical activity, stress, or sleep.[20]

Amadeus uses Couchbase with Apache Kafka to support their “open, simple, and agile” strategy to consume and integrate data on loyalty programs for airline and other travel partners. High scalability is needed when disruptive travel events create a need to recognize and compensate high value customers.[21]

Starting in 2012, it played a role in LinkedIn's caching systems, including backend caching for recruiter and jobs products, counters for security defense mechanisms, for internal applications.[22]

Alternatives

For caching, Couchbase competes with Memcached and Redis. For document databases, Couchbase competes with other document-oriented database systems. It is commonly compared with MongoDB, Amazon DynamoDB, Oracle RDBMS, DataStax, Google Bigtable, MariaDB, IBM Cloudant, Redis Enterprise, SingleStore, and MarkLogic.[23][24]

Bibliography

References

  1. Damien Katz (January 8, 2013). "The Unreasonable Effectiveness of C". http://damienkatz.net/2013/01/the_unreasonable_effectiveness_of_c.html. 
  2. 2.0 2.1 "Couchbase Adopts BSL License". 26 March 2021. https://www.couchbase.com/blog/couchbase-adopts-bsl-license/. 
  3. "NewProtocols - memcached - Klingon - Memcached - Google Project Hosting". 2011-08-22. https://code.google.com/archive/p/memcached/wikis/NewProtocols.wiki. 
  4. Shashank Tiwari (31 August 2011). Professional NoSQL. John Wiley & Sons. pp. 15–16. ISBN 9781118167809. 
  5. "Balancing Oracle and open source at Orbitz". GigaOM. September 21, 2012. https://gigaom.com/cloud/balancing-oracle-and-open-source-at-orbitz/. 
  6. 6.0 6.1 Andrew Brust (December 12, 2012). "Couchbase 2.0 released; implements JSON document store". ZDNet. https://www.zdnet.com/article/couchbase-2-0-released-implements-json-document-store/. 
  7. Derrick Harris (July 29, 2011). "Couchbase goes 2.0, pushes SQL for NoSQL". GigaOm. https://gigaom.com/2011/07/29/couchbase-2-0-unql-sql-nosql/. 
  8. Trond Norbye (March 15, 2010). "Want to know what your memcached servers are doing? Tap them". Couchbase blog. https://www.couchbase.com/blog/want-know-what-your-memcached-servers-are-doing-tap-them. 
  9. Frank Weigel (October 30, 2012). "Benchmarking Couchbase". Couchbase. https://www.couchbase.com/nosql-resources/presentations/benchmarking-couchbase%5B2%5D.html. 
  10. "Cisco and Solarflare Achieve Dramatic Latency Reduction for Interactive Web Applications with Couchbase, a NoSQL Database". Cisco Systems. June 18, 2012. http://www.cisco.com/en/US/prod/collateral/switches/ps9441/ps9670/white_paper_c11-708169.pdf. 
  11. "Couchbase Open Source Projects". Couchbase web site. http://developer.couchbase.com/open-source-projects/. 
  12. "Couchbase Server Editions". Couchbase. https://www.couchbase.com/couchbase-server/editions/. 
  13. Andy Slater (March 24, 2015). "Ssssh! don't tell anyone but Couchbase is a serious contender: Couchbase Live Europe 2015". https://n4stack.io/2015/03/24/couchbase-live-europe-2015/. 
  14. "DB-Engines: Couchbase including Mobile". https://db-engines.com/en/system/Couchbase. 
  15. "Lite | Couchbase". https://www.couchbase.com/products/lite. 
  16. "Sync Gateway Couchbase". https://db-engines.com/en/system/Couchbase. 
  17. Jaquier, Yannick (2016-09-27). "Couchbase server as a Memcached cluster (part 2)" (in en-US). https://blog.yannickjaquier.com/couchbase/couchbase-server-memcached-cluster-2.html. 
  18. "Introduction to Couchbase - NoSQL Document Database" (in en). https://www.todaysoftmag.com/article/1506/introduction-to-couchbase-nosql-document-database. 
  19. "Couchbase Mobile" (in en). 6 February 2022. https://dev.to/jawidmuhammadi/couchbase-mobile-3dmf. 
  20. "How Northwestern's Catalyst Lab scales healthy behavior program with Couchbase" (in en-US). 2021-12-31. https://venturebeat.com/2021/12/31/northwesterns-catalyst-lab-scales-healthy-behavior-program-with-couchbase/. 
  21. "Amadeus Loyalty wins the Couchbase Community Award under the Cloud Computing Category". January 20, 2022. https://amadeus.com/en/insights/blog/amadeus-loyalty-wins-couchbase-award-for-cloud-computing. 
  22. Michael Kehoe (December 6, 2017). "Couchbase Ecosystem at LinkedIn" (in en). https://engineering.linkedin.com/blog/2017/12/couchbase-ecosystem-at-linkedin. 
  23. Inc, Gartner. "Top Couchbase Competitors and Alternatives - Gartner 2022 - Cloud Database Management Systems". https://www.gartner.com/market/cloud-database-management-systems/vendor/couchbase/alternatives. 
  24. "MongoDB to Couchbase: An Introduction to Developers and Experts - DZone Database" (in en). https://dzone.com/articles/introduction-to-couchbase-for-mongodb-developers-a-1. 

External links