Strong consistency primer
Strong consistency means every read returns the result of the most recent successful write, across every replica, in real wall-clock order. Meridian gives you this guarantee on a per-key basis via the consistency: "strong" request flag, backed by a Raft quorum on the key's home shard.
01.When you actually need it
Strong consistency costs latency. The quorum round-trip adds 8–25ms over the eventual path. Reach for it only when stale reads cause correctness bugs: balance checks before a debit, rate limit counters, idempotency keys, or a leader-election cell. For feed reads, search indices, and display caches, the default eventual path is the right call.
02.How to request it
Set the consistency flag on both the write and the subsequent read. The write commits only after the quorum acks; the read is routed to the current Raft leader for that shard and bypasses every follower replica.
// Strong write + strong read on the same key
await meridian.kv.set("balance:user_42", 18250, {
consistency: "strong",
});
const fresh = await meridian.kv.get("balance:user_42", {
consistency: "strong",
});
// fresh === 18250, guaranteed, no matter which region
// the read originated from.03.Failure modes
If the leader for a shard is unreachable, a strong read returns QUORUM_UNAVAILABLErather than silently degrading to a stale value. Catch it, retry with exponential backoff up to three attempts, and if it still fails, surface the error to the caller. Do not fall back to an eventual read for a path that needed strong consistency in the first place — that defeats the guarantee.