Crate graph_mvcc

Crate graph_mvcc 

Source
Expand description

§Graph MVCC

A Rust crate implementing a Multiversion Concurrency Control (MVCC) graph database. This crate provides a transactional graph data structure with support for nodes, edges, and snapshot isolation. It ensures atomic operations, consistent views of the graph state, and conflict detection for concurrent transactions.

§Features

  • Transactional Operations: Supports atomic transactions with commit and rollback capabilities.
  • Snapshot Isolation: Ensures each transaction sees a consistent view of the graph at the time it starts.
  • Node and Edge Management: Allows creation and manipulation of nodes and edges with type-based collision detection.
  • MVCC: Implements multiversion concurrency control to manage concurrent transactions without conflicts.

§Usage

Below is an example of how to use the Graph struct to create nodes and edges within a transaction:

use graph_mvcc::{Graph, IGraph};

let mut graph = Graph::new();
let mut tx = graph.start_transaction();

// Add nodes
let node1 = graph.add_node(&mut tx);
let node2 = graph.add_node(&mut tx);

// Add an edge between nodes
graph.add_edge(&mut tx, &node1, &node2, "CONNECTS".to_string()).unwrap();

// Commit the transaction
graph.commit_transaction(&tx).unwrap();

Structs§

Edge
Graph
Node
TransactionId
A transaction ID (also called an TXID) is the unique number for the transaction. All records that have been modified under the same transaction can be saved or rolled back as one atomic operation, which is ultimately what we want.
TypePath

Enums§

EdgeId
Possibility A Possibility is a data structure that holds a commit record in one of the three states listed in Commit Record State: waiting, complete, or aborted. The lifetime of the Possiblity is assigned upon it’s creation. TODO:
MVCC
NodeId
TxError

Traits§

IGraph

Type Aliases§

TxResult