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 actions like rolling restarts or scaling down.
Set up an SC namespace
- 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.
- 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 mode can not be enabled or disabled on an already-deployed cluster.
- 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.