Storage Engines
- Capella Operational
- how-to
Capella supports two different backend storage engines: Magma and Couchstore.
You can choose between the Couchstore or Magma storage engines at the bucket level when creating a bucket. A single Capella cluster can have a mix of Couchstore and Magma buckets.
The choice of which storage engine to use depends on your use case and the size of your dataset. When using Couchbase Server 8.0 or later, Magma is the recommended storage engine for most use cases.
Understanding the strengths and weaknesses of each backend storage engine helps you choose the one that best suits your requirements.
| Couchstore | Magma [1] | |
|---|---|---|
Minimum bucket memory quota |
100 MiB |
|
Minimum memory to data ratio |
10% |
1% |
Maximum data per node |
1.6 TiB |
| [1] |
Magma’s minimum memory requirement depends on the number of vBuckets. |
|
XDCR between Magma and Couchstore
Only Couchbase Server 8.0 and later supports XDCR replication between buckets with different numbers of vBuckets. Couchstore buckets use 1024 vBuckets, while Magma buckets can use either 128 or 1024 vBuckets. To create an XDCR replication from a bucket on a cluster using Couchbase Server 7.6 or earlier, you must use Magma with 1024 vBuckets or Couchstore. |
Magma
Magma is the default backend storage engine in Capella. Magma is optimized for high-performance applications with large datasets that exceed available memory capacity. Disk access performance depends on the underlying disk subsystems.
Magma can work with low amounts of memory for large datasets. For example, a node holding 5 TiB of data can use Magma with only 64 GiB RAM. This efficiency is from Magma’s optimized disk access and memory management techniques.
Magma gives you the choice between 128 and 1024 vBuckets. If you allocate 1 GiB or more memory per node to your bucket, the 1024 vBucket option delivers better performance at scale.
When to Use Magma
You should use Magma if:
-
Your working set is much larger than the available memory, and you only rely on disk access speed.
-
You need to store and access large amounts of data using the lowest amount of memory.
-
Your applications make heavy use of transactions with persistence-based durability.
Couchstore
Couchstore delivers high performance while efficiently using system resources where memory is sufficient. Couchstore is ideal for small datasets that fit entirely in-memory.
Migrating a Couchstore Bucket to Magma
-
Couchbase Server 7.6+
-
Couchbase Server 7.2
Couchstore to Magma migration is only possible when the target Magma bucket has 1024 vBuckets. If your cluster in Capella uses Couchbase Server 7.6 or later, migrate your Couchstore buckets to Magma by making a PUT - Migrate Buckets call to the Management API.
PUT - Migrate Buckets can migrate 1 or more Couchstore buckets to Magma while your cluster is running. The API runs a swap rebalance of your cluster’s Data Service nodes. Your cluster shows a rebalancing state during the operation.
Before using PUT - Migrate Buckets, check that the buckets you’re migrating meet the requirements for Magma.
If the bucket fails to meet those requirements, the API call returns "errorType": "MagmaBucketSizeTooSmall".
If your cluster in Capella uses Couchbase Server 7.2, you must create a new bucket with the Magma storage engine and then copy the data. To create a bucket with the Magma storage engine, follow the steps in Create a Bucket and select Magma as the storage backend during bucket creation.