Files
turso/core/mvcc
Piotr Sarna 6d2a4150aa database: fix an unwrap() in tx_commit
It was a legit error -> the transaction doesn't have to be active
when commit() is called on it, and the right behavior in that case
is to return a TxTerminated error.

Fixes https://github.com/penberg/tihku/issues/59
2023-07-09 11:15:48 +02:00
..
2023-05-09 10:41:33 +03:00
2023-04-08 15:14:05 +03:00
2023-06-19 11:15:20 +03:00

Tihku

Tihku is an work-in-progress, open-source implementation of the Hekaton multi-version concurrency control (MVCC) written in Rust. The project aims to provide a foundational building block for implementing database management systems.

One of the projects using Tihku is an experimental libSQL branch with MVCC that aims to implement BEGIN CONCURRENT with Tihku improve SQLite write concurrency.

Features

  • Main memory architecture, rows are accessed via an index
  • Optimistic multi-version concurrency control
  • Rust and C APIs

Experimental Evaluation

Single-threaded micro-benchmarks

Operations Throughput
begin_tx, read, and commit 2.2M ops/second
begin_tx, update, and commit 2.2M ops/second
read 12.9M ops/second
update 6.2M ops/second

(The cargo bench was run on a AMD Ryzen 9 3900XT 2.2 GHz CPU.)

Development

Run tests:

cargo test

Test coverage report:

cargo tarpaulin -o html

Run benchmarks:

cargo bench

Run benchmarks and generate flamegraphs:

echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
cargo bench --bench my_benchmark -- --profile-time=5

References

Larson et al. High-Performance Concurrency Control Mechanisms for Main-Memory Databases. VLDB '11

Paper errata: The visibility check in Table 2 is wrong and causes uncommitted delete to become visible to transactions (fixed in commit 6ca3773).