Choosing Aerospike Commit Levels: Balancing Write Latency and Data Durability
A decision guide on Aerospike commit levels, comparing Async and Sync modes to balance write latency against data durability and consistency.
22 Jan 2026, 17:26 UTC

The Durability vs. Latency Trade-off
When configuring Aerospike, the most critical decision regarding write performance is the commit level. This setting determines when the server tells the client a write was successful: immediately upon receiving the data, or only after the data has been safely replicated to other nodes in the cluster.
Choosing the wrong level leads to either unacceptable application latency (if too strict) or catastrophic data loss during a node failure (if too permissive). The goal is to align the commit level with your specific Recovery Point Objective (RPO).
Comparing Commit Level Options
Aerospike allows you to define how many replicas must acknowledge a write before the operation is considered complete. This is typically configured at the namespace level or overridden via client-side policies.
| Option | Acknowledgment Trigger | Latency | Durability Risk | Best Use Case |
|---|---|---|---|---|
| Async (One) | Primary node receives write | Lowest | High (Loss if primary fails before replication) | Real-time telemetry, session caches |
| Sync (All) | All replicas acknowledge write | Highest | Low (Data survives multiple node failures) | Financial ledgers, user account balances |
Engineering Trade-offs
Network Topology Constraints
The impact of a SYNC commit level is magnified by your network architecture. In a single-rack deployment, the round-trip time (RTT) for replication is negligible. However, if your cluster spans multiple availability zones or uses Cross-Datacenter Replication (XDR), SYNC writes can cause application-level timeouts and severe throughput degradation because the primary node must wait for a response across the WAN.
Storage Engine Influence
The storage engine interacts with the commit level to define the total risk profile:
- RAM-only: Data is volatile. Even a
SYNCwrite is lost if the entire cluster loses power. - Hybrid Memory: Data is written to an index in RAM and a record in Flash (NVMe). A
SYNCwrite here ensures the data is persisted to non-volatile media on multiple nodes, providing the highest durability.
Implementation and Validation
Commit levels are primarily managed via the namespace configuration in aerospike.conf. To ensure strong consistency, you must set the write-block-timeout to allow enough time for replicas to respond.
Configuration Example
To configure a namespace for high durability (Sync), modify your server configuration file (typically /etc/aerospike/aerospike.conf) with the following parameters:
namespace test {
storage-engine device
replication-factor 2
# Ensure the write is committed to all replicas
# This is often handled via the client policy,
# but the server must support the replication factor.
write-block-timeout 100ms
}
Client-Side Control (Java Example)
While the server manages the data, the client defines the WritePolicy to specify the required acknowledgment. Run this within your application logic using the Aerospike Java Client:
WritePolicy wp = new WritePolicy();
// Set to ALL to ensure all replicas acknowledge the write
wp.commitLevel = CommitLevel.ALL;
// Set a timeout to prevent the application from hanging on network lag
wp.timeout = 500;
client.put(wp, key, bins);
Verification and Diagnostics
To verify the current state of your cluster and ensure the namespace is operating under the expected storage and replication settings, run the asinfo tool on any cluster node (requires root or aerospike user permissions):
# Check replication factor and namespace settings
asinfo -v "namespace-config"
Expected Result: The output should list the replication-factor matching your design. If you are using CommitLevel.ALL, ensure the replication-factor is greater than 1; otherwise, the setting has no effect.
Limitations and Risks
- Write Amplification: Using
SYNCincreases the internal network traffic and CPU load on replica nodes. - Availability Risk: If you require
ALLreplicas to acknowledge a write and one replica node is down or lagging, the write operation will fail, potentially reducing your system's write availability. - Timeout Cascades: If
write-block-timeoutis set too low for aSYNCconfiguration, you will see an increase inTIMEOUTerrors in your client logs, even if the data eventually reaches the server.
Rollback Procedure
If SYNC writes are causing application timeouts, revert to ASYNC by updating the client WritePolicy to CommitLevel.ONE. This change takes effect immediately upon application restart and does not require a server reboot.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.