StateVec offers two execution modes for the same deterministic business plugin. Verify mode is the default and checks execution results before commit. Performance mode runs business logic after commit, shortening the pre-commit path.

The same transaction foundation

Both modes use Raft to establish one ordered, durable transaction history. Each command is a transaction: its record changes are installed together on success, while a business rejection leaves its records unchanged. Commands execute serially against the effects of earlier commands.

Both validate request structure before admission, perform the required log writes and disk syncs, and recover from a selected checkpoint plus the committed Raft log. Performance mode retains these guarantees while shortening the pre-commit path.

Commit and apply are separate. Commit fixes a command’s place in durable history. Apply executes that command and installs its business changes. In both modes, the final response is returned after the committed batch is applied locally.

Full Consistency · Verify mode

Verify mode adds execution agreement to the replication path. Use it when independent verification of business results is a priority, such as balances, ledgers, settlement and limits.

  1. Simulate. The leader runs the commands from a known starting state and computes expected outcomes and hashes. Simulation does not install business changes.
  2. Verify and persist. Voting followers independently execute the same commands and compare their results with the leader’s. They satisfy the required persistence barrier before acknowledging replication.
  3. Commit. Raft commits once a quorum acknowledges. A follower that fails verification cannot acknowledge that replication; the cluster does not automatically switch to Performance mode.
  4. Apply and respond. Each node applies the committed commands. Verified simulation results can be reused only when the starting state, inputs and expected results match exactly; otherwise execution is repeated and checked.

Verify mode detects execution divergence between replicas. It depends on deterministic, trusted plugins; a business-rule defect shared by all replicas still requires application testing. A single-voter cluster has no independent follower verification.

Extreme Performance · Performance mode

Performance mode removes simulation and execution-result comparison from the pre-commit path. Use it when throughput is the priority and the application accepts execution after commit without that independent pre-commit check.

  1. Validate. Check the request’s structure and encoding before admission.
  2. Replicate and commit. Persist commands through Raft with the same required disk syncs and quorum commitment.
  3. Execute and respond. Run the committed commands in order, install successful changes, and produce business outcomes and a hash-linked transaction history.

A business rejection is a normal outcome and leaves that command’s records unchanged. An execution fault on a committed command stops the node and preserves committed history for recovery.

Performance mode computes transaction-chain hashes during execution. It omits the pre-commit result comparison used in Verify mode, and background cross-replica chain sampling is not currently provided.

Choose the verification path

Guarantee or behaviorFull Consistency · Verify modeExtreme Performance · Performance mode
Raft ordering and quorum persistenceProvidedProvided
Atomic command execution and serial orderProvidedProvided
Execution before commitLeader simulation and follower verificationBusiness execution begins after commit
Independent result comparison before commitVoting followers compare resultsOmitted
Final responseAfter committed applyAfter committed apply
RecoverySelected checkpoint and committed logSelected checkpoint and committed log

Start with Verify mode when verification is the main requirement. Choose Performance mode explicitly when the shorter pre-commit path suits the workload. Compare throughput and completion latency under the same commands, batch sizes and storage configuration; the published measurements report both modes.

Both modes return each command’s business outcome after the complete batch is applied. Batching shares replication costs across commands; it does not turn the batch into one all-or-nothing transaction. Asynchronous query views can lag behind the transaction core in either mode.

References and examples