Blazing fast ACID and MVCC in memory database based on lock-free skiplist.
async-skipdb
uses the same SSI (Serializable Snapshot Isolation) transaction model used in badger
.
English | 简体中文
Introduction
Blazing fast ACID and MVCC in memory database based on lock-free skiplist.
async-skipdb
uses the same SSI (Serializable Snapshot Isolation) transaction model used in badger
.
For sync version, please see skipdb
.
Features
- ACID, MVCC, serializable snapshot isolation, concurrent safe and almost lock-free.
- No extra allocation and copy, there is no
Arc
wrapper for both key and value stored in the database, which means that users provideK
andV
, and database storeK
andV
directly. - Zero-copy and in-place compaction, which means there is no copy, no extra allocation when compacting.
- Concurrent execution of transactions, providing serializable snapshot isolation, avoiding write skews.
- Both read transaction and write transaction are
Send + Sync + 'static
, which means you do not need to handle annoying lifetime problem anymore. - Lock-free and concurrent safe read transaction: the read transaction is totally concurrent safe and can be shared in multiple threads, there is no lock in read transaction.
BTreeMap
like user friendly API and all iterators implementIterator
trait, which means users use Rust powerful conbinators when iterating over the database.- Runtime agnostic,
tokio
,async-std
,smol
,wasm-bindgen-futures
and any other async runtime. - 100% safe, sets
[forbid(unsafe_code)]
.
Installation
-
tokio
[] = { = "0.1", = ["tokio"] }
-
async-std
[] = { = "0.1", = ["async-std"] }
-
smol
[] = { = "0.1", = ["smol"] }
-
wasm-bindgen-futures
[] = { = "0.1", = ["wasm"] }
Example
-
If your
K
implementHash
.use TokioEquivalentDb; async
-
If your key cannot implement
Hash
for some reasons.Then you can use
ComparableDb
, but this will requireK: CheapClone + Ord
, you can seecheap_clone
trait for more details.use TokioComparableDb; async
License
async-skipdb
is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2024 Al Liu.