limbo/core/mvcc
Piotr Sarna 7a6ca27986 database: make sure row versions are inserted in a sorted order
For the time being, we still assume that the row versions vector
is *nearly* sorted, so we just perform a linear reverse search
and insert the version at an appropriate place.

During concurrency tests, the error was at most 1 offset,
and as long as we empirically prove it to be below a reasonable
constant, we're fine. Otherwise we should consider switching
to either a data structure that keeps elements ordered,
or at least a list that gives us constant insertion.
2023-06-13 11:24:19 +02:00
..
.github/workflows database: fix the locking order in transactions 2023-06-12 16:22:45 +02:00
bindings/c treewide: overhaul the API to be sync again 2023-05-17 12:39:08 +02:00
docs Rename mutations.png to transactions.png 2023-05-10 13:01:33 +03:00
mvcc-rs database: make sure row versions are inserted in a sorted order 2023-06-13 11:24:19 +02:00
.gitignore Add mvcc.h to the tree 2023-05-09 10:41:33 +03:00
Cargo.toml Rename database directory to mvcc-rs 2023-05-09 10:56:46 +03:00
LICENSE.md Initial commit 2023-04-08 15:14:05 +03:00
README.md Update README.md 2023-05-09 10:42:05 +03:00

MVCC for Rust

This is a work-in-progress the Hekaton optimistic multiversion concurrency control library in Rust. The aim of the project is to provide a building block for implementing database management systems.

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).