Sizing a Cluster

Couchbase Cloud provides several features that can help you appropriately size your cluster to fit your needs.

Correctly sizing a cluster is critical to its overall stability and performance. Couchbase Cloud simplifies (and in some cases, eliminates) most of the traditional complexities of sizing a Couchbase Server deployment, making it much easier to get started with the right size cluster.

Cluster sizing is configured during the cluster creation process (though you can always scale a cluster after it’s created). This page goes over how to use the available sizing tools to create your cluster’s deployment configuration.

Deployment Configuration

A cluster’s deployment configuration is made up of the following:

  • Couchbase services — type and quantity of nodes

  • Compute instance types

  • Storage capacities

A cluster deployment configuration created using the Custom Deployment Mode.

Each row represents a specific node configuration. Each node configuration includes the Couchbase services that will be deployed on the node, as well as the system resources (such as compute and storage) of the cloud VM that the node will be deployed on. Each node configuration will also have a quantity, which represents the number of nodes in the cluster that will have that configuration.

Couchbase Services

Sizing a cluster fundamentally depends on the services that make up the cluster. Each Couchbase service utilizes resources differently, so it’s important to know which resources are most important for each service as you go about sizing your cluster.

The following topics can be helpful in understanding Couchbase services and how to size them:

Compute — CPU and RAM

CPU sizing is measured in:

  • Clock speed of vCPUs

  • Number of vCPUs

RAM sizing is measured in:

  • Capacity (GB)

CPU sizing (both clock speed and number of vCPUs), as well as RAM sizing, are both determined by the instance types available from your cloud provider. Couchbase Cloud curates these instance types and only exposes the ones that are optimal for running Couchbase.

The amount of RAM and vCPUs in your deployment can only be sized in multiples, rather than arbitrary amounts. This is because the amount of RAM and vCPUs will always be a multiple of the RAM and vCPUs of the instance types in your configuration. (A good way to observe this principle in action is by trying out the Sizing Calculator.)

Storage

Storage sizing is measured in:

  • Capacity (GB)

Storage sizing is determined by the capacity you specify in GB.

Couchbase Cloud automatically chooses the optimal storage type available from your cloud provider to meet the I/O requirements of your configuration.

Templates

Cluster templates provide pre-defined cluster configurations that are based on common workloads. Each template has a variety of different sizes, and selecting one will populate the entire cluster configuration for you.

The template sizing screen with the 'Query Optimized' template selected.

When using template sizing, the Deployment Configuration will display the services and resources that make up the template. Individual details of the configuration can’t be edited, but a toggle is available to switch between different sizes of the template.

Templates are a good place to start when it comes to sizing your first cluster in Couchbase Cloud. You can always deploy a cluster using a template, and then modify it later if it’s not meeting your needs. Though, keep in mind the following restrictions:

  • Clusters deployed with template sizing can only be scaled by adding or removing a node of the same instance type.

  • Clusters deployed with the Quick Start template cannot be scaled.

Only clusters deployed using the Custom Deployment Mode can be scaled in any dimension (both nodes and instances).

Sizing Calculator

If you already know a little bit about the data that you’ll be storing and how you’ll be using it, you can use the Sizing Calculator to help you size your cluster configuration so that it is tailored to your needs.

The Sizing Calculator screen with the 'Data' tab selected.

The Sizing Calculator works by setting sizing assumptions for each service. Sizing assumptions are a set of metrics about your data usage that can be used to provide a relatively accurate idea for how large your cluster needs to be in order to accommodate your workloads.

Once you set your sizing assumptions, each of the resource sizing toggles will reflect how much capacity your cluster will have (based on your sizing assumptions).

Data

When using the Sizing Calculator to size the Data service, you’ll first need to set sizing assumptions about your data:

The 'Data Sizing Assumptions' slide-out menu.
Number of Replicas

This is the number of per-bucket replicas your buckets will have.

Number of XDCR Streams

This is the number of XDCR streams you plan to have per-bucket.

Average Key Size (bytes)

This is the average size of each document’s key (sometimes referred to as a document ID).

Average Doc Size (bytes)

This is the average size of the value (binary) or document (JSON) of each data item.

After setting the sizing assumptions, you can start using the toggles to allocate resources to the Data service:

The Sizing Calculator screen with the 'Data' tab selected, specifically showing the toggles to configure resource allocation for the Data service.
Memory

The amount of memory you specify with the Memory toggle will dictate the amount of data items you can store as in-memory cache (also known as the working-set data). Underneath the toggle you’ll see the estimated percentage of total data items that will be stored in memory as your working-set data.

Only Couchbase buckets are supported in Couchbase Cloud. This means that disk persistence is enabled by default, and the total amount of data items that your cluster can store is determined by Disk Size.
Disk Size

The amount of storage you specify with the Disk Size toggle needs to be enough to store the total amount of all data items. Underneath the toggle you’ll see the estimated number of data items, based on your sizing assumptions, that the amount of specified storage will hold.

As you use the toggles to configure Data service sizing, take notice of the Data service node configuration in the Deployment Configuration panel. Couchbase Cloud will use your inputs to automatically choose the appropriate compute instances and quantity of nodes.

Query & Indexing

When using the Sizing Calculator to size the Query and Index services, you’ll first need to set sizing assumptions about your data and usage:

The 'Query and Indexing Sizing Assumptions' slide-out menu.
Actual Mutation Rate (per second)

This is the average number of actual bucket mutations per second.

Average Key Size (bytes)

This is the average size of each document’s key (sometimes referred to as a document ID).

Average Doc Size (bytes)

This is the average size of the value (binary) or document (JSON) of each data item.

Enable Primary Index

Use this toggle to indicate whether or not you plan on using primary indexes.

A primary index is based on the unique key of every item in a bucket. A primary index is intended to be used for full bucket scans (primary scans) when the query does not have any filters (predicates) or when no other index or access path can be used.

After setting the sizing assumptions, you can start using the toggles to allocate resources to the Query and Index services:

The Sizing Calculator screen with the 'Query & Indexing' tab selected, specifically showing the toggles to configure resource allocation for the Query and Index services.
Index Disk Size

The amount of storage you specify determines how many total documents can be stored in indexes. Underneath the toggle you’ll see the estimated number of documents, based on your sizing assumptions, that can be stored in indexes given the amount of specified storage.

Index Memory

The amount of memory you specify determines how much index data can be stored in memory. (More memory allows for processing a higher rate of sustained changes per second.) Underneath the toggle you’ll see the estimated percentage of indexes that will be stored in memory.

Index CPUs

The number of CPUs you specify determines how many scan operations and mutations per second the Index service can support given the size of your indexes. Underneath the toggle you’ll see the estimated number of scans and mutations are supported given the specified index size and CPUs.

Query Dedicated CPUs

The number of CPUs you specify determines the volume and complexity of N1QL queries the cluster can support. Underneath the toggle you’ll see the estimated capacity that the Query service will have given the specified number of CPUs.

As you use the toggles to configure Query and Indexing sizing, take notice of the Query and Index node configurations in the Deployment Configuration panel. Couchbase Cloud will use your inputs to automatically choose the appropriate compute instances and quantity of nodes.

Other Services

When using the Sizing Calculator to size services other than Data, Query, and Index, you’ll use toggles to select the quantity of nodes for each additional service, and then manually specify the compute instances and storage size in the Deployment Configuration itself:

The Sizing Calculator screen with the 'Other Services' tab selected, with the toggles for Full Text Search, Analytics, and Eventing all showing one node configured.

Custom Deployment Mode

The Custom Deployment mode allows you the most granular control over sizing and configuring your cluster. This option works well if you already have experience with Couchbase Server and/or want to re-create an existing Couchbase deployment using Couchbase Cloud.

When using the Custom Deployment mode, you’ll use the '+' icon to add different node configurations. Each node configuration represents a single row in the Deployment Configuration, and is made up of the following configurable specifications:

  • The individual services that will run on the node

  • The quantity of nodes (e.g. the number of instances of the node configuration)

  • The type of compute instance that the node configuration will run on

  • The type of storage that the node configuration will use

  • The storage capacity available on each node

The Custom Deployment mode screen showing a re-creation of the 'Query Optimized' medium template.