Multi-Version Concurrency Control (MVCC) enables snapshot isolation and time-travel queries in HexxlaDB. Multiple versions of data coexist, with visibility scoped by commit sequence numbers.Documentation Index
Fetch the complete documentation index at: https://hexxladb.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
MVCC in HexxlaDB provides:- Snapshot isolation — Readers see a consistent snapshot without blocking writers
- Time-travel queries — Query the database as it was at any point in time
- Audit trails — Full history of changes with changelog integration
- Non-blocking reads — Read transactions never block write transactions
Enabling MVCC
MVCC is enabled via options:Physical key encoding
With MVCC enabled, version suffixes are appended to physical B+ tree keys:commit_seq.
Timeline keys
Timeline keys map wall-clock time to commit sequence numbers:ViewAtTime queries by translating wall-clock timestamps to snapshots.
Snapshot transactions
View (current snapshot)
ViewAt (by commit sequence)
ViewAtTime (by wall-clock time)
Write transactions
Write transactions create new versions:Version visibility
Readers see versions based on their snapshot:- View: Latest committed snapshot
- ViewAt: State as of specific commit sequence
- ViewAtTime: State as of specific wall-clock time
Snapshot diff
Compare two snapshots to see what changed:Retention and pruning
Configure MVCC retention:MVCC statistics
Query MVCC stats:Validity windows
MVCC snapshots are orthogonal to validity windows on records:- MVCC: Engine-time snapshot isolation (what the database knew at commit time)
- Validity: Real-world time range (when the fact was true)
Changelog integration
MVCC works with the logical changefeed for audit trails:Performance considerations
- Read performance: Unaffected by MVCC (snapshot reads are fast)
- Write performance: Slight overhead for version tracking
- Storage: Additional space for old versions (mitigated by retention and pruning)
- Compaction: Essential for reclaiming space from old versions
Use cases
Audit trails
Track exactly what the database knew at any point:Debugging
Reproduce issues by querying the database state at the time of the error:Time-travel queries
Explore how data evolved over time:See also
- Storage layout — Physical key encoding with MVCC suffixes
- Changelog — Logical changefeed for audit trails
- API reference — MVCC API methods