Consistency and Acknowledgments
Swytch is an in-memory database with causal history and serializable transactions within an agreement domain. Use this contract to decide when an application can report success, when it can retry, and what storage it needs.
A transaction groups the reads and writes needed for one decision. With interactive SSI, commands return snapshot
results immediately, but those results remain provisional until EXEC succeeds. Other connections see committed state.
A successful transaction commit requires responses from all current subscribers to the transaction’s keys. Peers
exchange the envelope and conflict evidence before confirmation. This requirement applies under both safe and
unsafe; the latter skips the availability preflight, not the commit protocol.
A key without other subscribers can commit locally. Subscriptions identify participants through use. Merely adding nodes does not make every node a subscriber or create a replica of every key.
| Client outcome | Meaning | Application action |
|---|---|---|
Successful EXEC array | The transaction committed; entries contain command results | Handle any command-level errors in that array and report the resulting decision |
Null EXEC | Conflict or failed watch caused an abort | Retry all reads and decisions from a fresh MULTI |
AMBIGUOUS | Commit may have occurred | Reconcile the operation ID before repeating work |
| Lost connection while waiting for commit | The client lacks a definitive outcome | Treat the outcome as unknown |
Runtime errors in individual commands do not automatically abort an entire transaction. Issue DISCARD if a failed
command invalidates the application’s decision. The transaction guide provides the full workflow.
Ordinary commands use causal effects and operation-specific execution paths. Some perform implicit transactions; others propagate effects without that transaction barrier. Do not infer a universal subscriber acknowledgment barrier from a successful ordinary command reply.
Causal dependencies preserve the relationship between observed operations. Concurrent effects are reconstructed according to their semantics. An increment and a replacement assignment do not make the same claim about their result. Use the data guides and command reference for the operation being integrated.
Transactions are serializable within their participating domain. Disconnected domains have independent histories; they cannot establish a shared global serial order without communication. When histories meet, Swytch reconstructs a valid combined order or exposes qualifying conflicts for reconciliation.
This preserves evidence of decisions rather than discarding a former primary’s history during failover. A retained transaction history and a currently visible value are different things. Conflict reports let applications inspect that evidence.
| Boundary | What it establishes |
|---|---|
| Transaction acknowledgment | Commit coordination with the current subscribers completed |
| Local mirror sync | The synced resident effects reached this node’s disk |
| Cloud upload acknowledgment | The uploaded effects reached the network storage tier |
Local disk sync and Cloud uploads are asynchronous. Transaction success does not wait for either. Surviving subscribers can retain shared state after a node fails; losing every holder requires a retained storage copy. Durability and tiering describes the choices, including eviction and recovery behavior.
The Jepsen harness checks operation histories under declared faults. Its SSI workload checks strict serializability in the tested configuration. Model specifications and deterministic regression tests provide additional, distinct evidence. None should be represented as a result for a different revision or topology.
For comparisons, Redis and Valkey’s own documentation explicitly permits acknowledged-write loss during failover. Apply the same questions about success, history, and storage to each database.