From 14f6436b86468cdd89b25a62b68fbf816051e0dc Mon Sep 17 00:00:00 2001 From: Al Liu Date: Sat, 27 Apr 2024 01:28:34 +0800 Subject: [PATCH] Update docs --- README.md | 2 +- async-skipdb/src/optimistic.rs | 9 +++++---- async-skipdb/src/optimistic/write.rs | 2 +- async-skipdb/src/serializable.rs | 8 +++++--- skipdb/src/optimistic.rs | 9 +++++---- skipdb/src/optimistic/write.rs | 2 +- skipdb/src/serializable/optimistic.rs | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1def498..c68b330 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This repository the implementation: 1. Generic optimistic transaction manger, which supports concurrent execution of transactions, providing serializable snapshot isolation, avoiding write skews. -2. An ACID, MVCC and WASM friendly in-memory database based on the transaction manager. +2. An atomicity, consistency, isolation, MVCC and WASM friendly in-memory database based on the transaction manager. [github][Github-url] LoC diff --git a/async-skipdb/src/optimistic.rs b/async-skipdb/src/optimistic.rs index 7bf8d90..da38b35 100644 --- a/async-skipdb/src/optimistic.rs +++ b/async-skipdb/src/optimistic.rs @@ -47,13 +47,14 @@ impl Inner { } } -/// A concurrent ACID, MVCC in-memory database based on [`crossbeam-skiplist`][crossbeam_skiplist]. +/// A concurrent MVCC in-memory key-value database. /// /// `OptimisticDb` requires key to be [`Ord`] and [`Hash`](Hash). /// -/// Comparing to [`SerializableDb`](crate::serializable::SerializableDb), -/// `OptimisticDb` has more flexible write transaction APIs and no clone happen. -/// But, [`SerializableDb`](crate::serializable::SerializableDb) does not require the key to implement [`Hash`](Hash). +/// Comparing to [`SerializableDb`](crate::serializable::SerializableDb): +/// 1. `SerializableDb` support full serializable snapshot isolation, which can detect both direct dependencies and indirect dependencies. +/// 2. `SerializableDb` does not require key to implement [`Hash`](core::hash::Hash). +/// 3. But, [`OptimisticDb`](crate::optimistic::OptimisticDb) has more flexible write transaction APIs and no clone happen. pub struct OptimisticDb { inner: Arc>, } diff --git a/async-skipdb/src/optimistic/write.rs b/async-skipdb/src/optimistic/write.rs index 1311d80..7d11c68 100644 --- a/async-skipdb/src/optimistic/write.rs +++ b/async-skipdb/src/optimistic/write.rs @@ -5,7 +5,7 @@ use skipdb_core::rev_range::WriteTransactionRevRange; use super::*; -/// A read only transaction over the [`OptimisticDb`], +/// A optimistic concurrency control transaction over the [`OptimisticDb`]. pub struct OptimisticTransaction { db: OptimisticDb, pub(super) wtm: AsyncWtm, BTreePwm, SP>, diff --git a/async-skipdb/src/serializable.rs b/async-skipdb/src/serializable.rs index 145d7e2..2483718 100644 --- a/async-skipdb/src/serializable.rs +++ b/async-skipdb/src/serializable.rs @@ -47,14 +47,16 @@ impl Inner { } } -/// A concurrent ACID, MVCC in-memory database based on [`crossbeam-skiplist`][crossbeam_skiplist]. +/// A concurrent MVCC in-memory key-value database. /// /// `SerializableDb` requires key to be [`Ord`] and [`CheapClone`]. /// The [`CheapClone`] bound here hints the user that the key should be cheap to clone, /// because it will be cloned at least one time during the write transaction. /// -/// Comparing to [`OptimisticDb`](crate::optimistic::OptimisticDb), `SerializableDb` does not require key to implement [`Hash`](core::hash::Hash). -/// But, [`OptimisticDb`](crate::optimistic::OptimisticDb) has more flexible write transaction APIs. +/// Comparing to [`OptimisticDb`](crate::optimistic::OptimisticDb): +/// 1. `SerializableDb` support full serializable snapshot isolation, which can detect both direct dependencies and indirect dependencies. +/// 2. `SerializableDb` does not require key to implement [`Hash`](core::hash::Hash). +/// 3. But, [`OptimisticDb`](crate::optimistic::OptimisticDb) has more flexible write transaction APIs. pub struct SerializableDb { inner: Arc>, } diff --git a/skipdb/src/optimistic.rs b/skipdb/src/optimistic.rs index 43d96fc..c9ebcd0 100644 --- a/skipdb/src/optimistic.rs +++ b/skipdb/src/optimistic.rs @@ -28,13 +28,14 @@ impl Inner { } } -/// A concurrent ACID, MVCC in-memory database based on [`crossbeam-skiplist`][crossbeam_skiplist]. +/// A concurrent MVCC in-memory key-value database. /// /// `OptimisticDb` requires key to be [`Ord`] and [`Hash`](Hash). /// -/// Comparing to [`SerializableDb`](crate::serializable::SerializableDb), -/// `OptimisticDb` has more flexible write transaction APIs and no clone happen. -/// But, [`SerializableDb`](crate::serializable::SerializableDb) does not require the key to implement [`Hash`](Hash). +/// Comparing to [`SerializableDb`](crate::serializable::SerializableDb): +/// 1. `SerializableDb` support full serializable snapshot isolation, which can detect both direct dependencies and indirect dependencies. +/// 2. `SerializableDb` does not require key to implement [`Hash`](core::hash::Hash). +/// 3. But, [`OptimisticDb`](crate::optimistic::OptimisticDb) has more flexible write transaction APIs and no clone happen. pub struct OptimisticDb { inner: Arc>, } diff --git a/skipdb/src/optimistic/write.rs b/skipdb/src/optimistic/write.rs index 3e3f4a0..d9103d8 100644 --- a/skipdb/src/optimistic/write.rs +++ b/skipdb/src/optimistic/write.rs @@ -5,7 +5,7 @@ use txn::{error::WtmError, HashCmOptions, PwmComparableRange}; use super::*; -/// A read only transaction over the [`OptimisticDb`], +/// A optimistic concurrency control transaction over the [`OptimisticDb`]. pub struct OptimisticTransaction { db: OptimisticDb, pub(super) wtm: Wtm, BTreePwm>, diff --git a/skipdb/src/serializable/optimistic.rs b/skipdb/src/serializable/optimistic.rs index 7fbb8bb..cb88276 100644 --- a/skipdb/src/serializable/optimistic.rs +++ b/skipdb/src/serializable/optimistic.rs @@ -8,7 +8,7 @@ use super::*; #[cfg(test)] mod tests; -/// A read only transaction over the [`OptimisticDb`], +/// A optimistic concurrency control transaction over the [`SerializableDb`]. pub struct OptimisticTransaction { pub(super) db: SerializableDb, pub(super) wtm: Wtm, BTreePwm>,