Skip to main content
Loading
Version: Operator 3.4.0

Strong Consistency

Overview

Aerospike's database can be configured as Available and Partition-tolerant (AP) or Consistent and Partition-tolerant (CP). Aerospike uses the term "strong consistency" (SC) when referring to CP mode.

In SC mode, database writes are guaranteed to be complete or to fail, with no partial writes possible. All writes across all nodes (pods) complete in the same order they were started, without any skipping or re-ordering.

When you use AKO to configure a strong consistency namespace, AKO deploys the namespace, manages the roster, and validates unavailable or dead partitions before operations like rolling restarts or scaling down.

Set up an SC namespace

  1. Add the strong-consistency: true parameter in the namespace section of the custom resource (CR) file.
  aerospikeConfig:
namespaces:
- name: test
replication-factor: 2
strong-consistency: true
storage-engine:
type: device
devices:
- /test/dev/xvdf

For the full CR file, see the strong consistency example in the main Aerospike Kubernetes Operator repository.

  1. Save and exit the CR file, then apply the change with kubectl.
kubectl apply -f aerospike-cluster.yaml

Limitations

If there are any dead partitions, AKO stops with an error and user intervention is needed to recover those partitions. For more information on unavailable and dead partitions, see Validating partition availability.

  • SC configurations cannot be updated in place.
  • All racks should have identical SC namespaces.
  • A cluster size smaller than the replication factor is allowed in AP mode but not in SC mode.

SC without AKO

To set up a strong consistency namespace without using AKO:

  1. Configure the namespace and set its roster.
  2. Update the roster whenever a node is added or removed from the cluster.
  3. Check for unavailable or dead partitions in the cluster before doing any operations like rolling restart and scale down.

For more information on setting up a strong consistency namespace without AKO, see Configuring strong consistency.