Aerospike offers Strong Consistency (SC) mode for applications that require absolute correctness of data. Developers should follow these Twelve Do's of Consistency to ensure optimal performance and reliability:
1. Model your data for single record atomicity.
2. Configure the namespace in SC mode by setting strong-consistency to true.
3. Use the Read-Modify-Write pattern for read-write transactions.
4. Tag a write with a unique id to confirm if a transaction succeeded or failed.
5. Achieve multi-operation atomicity and only-once effect through Operate, predicate expressions, and various policies.
6. Simplify write transactions by making write only-once (idempotent).
7. Record the details for subsequent handling in a batch or manual process if a write's outcome cannot be resolved.
8. Choose the optimal read mode based on performance and staleness guarantees.
9. Use the default value for max-retries (zero) in write-policy.
10. For maximum durability, commit each write to the disk on a per-transaction basis using commit-to-device setting.
11. For exactly-once multi-record (non-atomic) updates use the pattern: record atomically — post at-least-once — process only-once.
12. Resolve in-flight transactions during crash recovery by recording the transaction intent.