Transactions
BetterKV supports Redis-style transactional workflows, but the real developer question is when to use transactions versus Lua scripts versus plain pipelining.
MULTI and EXEC
Commands queue after MULTI and execute together at EXEC.
DISCARD
WATCH for optimistic concurrency
If a watched key changes before EXEC, the transaction aborts and the client should retry.
When to use what
Error model
- syntax or queueing errors can abort the transaction before
EXEC - runtime errors inside
EXECdo not roll back earlier successful commands
Comparison guidance
If you benchmark BetterKV against Redis and Valkey, transactions are another place to compare tail latency rather than only throughput. Publish contention-heavy cases, not only no-conflict happy paths.