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).
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, 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 three indexers:
Using these indexers, you can create two types of indexes:
- Incremental Map-Reduce View indexer
- Global Secondary Index (GSI) indexer
- Spatial Views indexer
- 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, Views (both Incremental Map-Reduce Views and Spatial Views) are placed within the data service as they are partition-aligned to the core data distribution. 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
You can retrieve data in a number of ways in Couchbase Server depending on the type of query.
- Querying with keys
Data service and core data operations provide a key based lookup. You can retrieve items based on the item key using the key-value API.
- Querying with value, document, or document attribute
- 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.
For more information about querying and retrieving data, see Querying data and query service.
- Querying with keys