Couchbase Server architecture
Couchbase Server is an open source scalable NoSQL database engine. The core architecture is designed to simplify building modern applications with a flexible data model and core database platform abilities ranging from high availability, high scalability, high performance all the way to security.
Couchbase Server consists of a single package that is installed on all nodes. Using SDKs (also known as smart client connectivity libraries), you can write applications in the language of your choice (Java, node.js, .NET, or others). The applications connect to a Couchbase Server cluster to perform read and write operations, and run queries with low latencies (sub millisecond) and high throughput (millions of operations per second).
To understand the Couchbase Server’s architecture, it is important to understand both the core components of the system and the behavior of core run time capabilities. For more information about the core runtime behavior, see the following topics:
Couchbase services are components that run specific independent workloads within the cluster. Databases handle three distinct workloads: core data operations, indexing, and query processing. Couchbase Server includes Data, Index, Search, and Query Services to enable independent deployment of these workloads within a cluster.
Each node can run all services or a subset of the services. As an administrator, you can create unique topologies using these independent services and independently scale the three workloads. For more information, see Services architecture and multidimensional scaling.
- Core data access and data service
Data Service provides the key-value API that you can use to perform CRUD operations (create, retrieve, update, and delete) on items with keys within buckets. For more information, see Data service and core data access.
- Indexing and index service
Indexes provide faster access to data in a bucket. Couchbase Server supports the following indexers:
Incremental Map-Reduce View indexer
Global Secondary Index (GSI) indexer
Spatial Views indexer
Full Text Search indexer
Using these indexers, you can create two types of indexes:
Primary indexes which index all the keys in a given bucket and are used when a secondary index cannot be used to satisfy a query and a full bucket scan is required.
Secondary indexes can index a subset of the items in a given bucket and are used to make queries targeting a specific subset of fields more efficient.
In Couchbase Server, both MapReduce view and spatial view indexers provide direct access to the indexes through the View API. Both the indexers are placed within the data service as they are partition-aligned to the core data distribution.
+ The full text search indexer (Developer Preview) provides direct access to indexers through the FTS API. FTS index is placed within its own service (FTS service) for independent scalability.
+ The Global Secondary Indexes (GSI) are deployed on nodes hosting the index service and can be independently partitioned for better performance and throughput with N1QL queries.
+ For more information about indexers and index services, see Views, indexing, and index services.
- Querying data and query service
With N1QL, you can query JSON documents using SQL-like syntax. You can also run ad-hoc queries with filters and aggregates over JSON data and reshape the JSON output. N1QL API is available through the query service.
Full text search indexer provides a Search API that can perform keyword searches directly on data in Couchbase Server. Search API is available through the Search service.
For more information about querying and retrieving data, see Querying data and query service.