Expand description
§SuperTable Transactions
This module implements ACID transactions with optimistic concurrency control (OCC). Transactions provide atomicity and isolation for table operations, enabling multiple writers to work concurrently without conflicts.
§Optimistic Concurrency Control
SuperTable uses OCC rather than pessimistic locking, which is better suited for data lake workloads where:
- Reads vastly outnumber writes
- Writes typically occur in batches (not high frequency)
- Lock contention would be impractical across distributed systems
§Conflict Detection
Conflicts are detected at commit time by comparing the transaction’s base sequence number with the current table state. If another writer committed changes that overlap with this transaction’s write set, the commit fails.
§Retry Strategy
When a conflict is detected, the transaction can optionally retry with configurable exponential backoff. The transaction re-reads the current state, re-applies changes, and attempts to commit again.
§Example
ⓘ
use supercore::transaction::Transaction;
let tx = Transaction::new(table_metadata);
tx.add_data_files(vec![data_file]);
let result = tx.commit(&catalog).await?;Structs§
- Prepared
Commit - A prepared commit ready for atomic application.
- Retry
Config - Configuration for transaction retry behavior.
- Transaction
- A transaction represents a unit of work against a table.
Enums§
- Isolation
Level - Isolation level for transactions.
- Transaction
Error - Errors that can occur during transaction operations.
Type Aliases§
- Transaction
Result - Result type for transaction operations.