Embedded graph database

Overview

CQLite

crates.io Released API docs CI MIT licensed

An embedded graph database implemented in Rust. This is currently a pre-release. It has not been extensively tested with 'real-world work-loads', and the file-format and API are not yet stabilized.

The longer term goal is to create an in-process graph database with a stable on-disk format and support for a wide range of programming languages, providing a native Rust API, as well as a C FFI interface.

use cqlite::Graph;

let graph = Graph::open_anon()?;

let mut txn = graph.mut_txn()?;
let edge: u64 = graph.prepare(
        "
        CREATE (a:PERSON { name: 'Peter Parker' })
        CREATE (b:PERSON { name: 'Clark Kent' })
        CREATE (a) -[e:KNOWS]-> (b)
        RETURN ID(e)
        "
    )?
    .query_map(&mut txn, (), |m| m.get(0))?
    .next()
    .unwrap()?;
txn.commit()?;

let name: String = graph.prepare(
        "
        MATCH (p:PERSON) <-[e:KNOWS]- (:PERSON)
        WHERE ID(e) = $edge
        RETURN p.name
        "
    )?
    .query_map(&mut graph.txn()?, ("edge", edge), |m| m.get(0))?
    .next()
    .unwrap()?;
assert_eq!("Clark Kent", name);

Architecture Overview

Parser :: src/parser

PEG grammar and parser for a subset of the CYPHER graph query language

Query Planner :: src/planner

Transforms a parsed query ast into a logical query plan. Performs some optimizations on the query plan.

Byte-Code Interpreter :: src/runtime

Defines a simple 'byte' code (Instructions) and can execute those against a given database, as well as generate instructions for a given query plan.

Storage Backend :: src/store

Uses a disc-backed btree to provide basic storage, iteration and lockup for nodes and edges.

You might also like...
A simple embedded key-value store written in rust as a learning project

A simple embedded key-value store written in rust as a learning project

Experimental blockchain database

A database for the blockchain. Design considerations API The database is a universal key-value storage that supports transactions. It does not support

Immutable Ordered Key-Value Database Engine

PumpkinDB Build status (Linux) Build status (Windows) Project status Usable, between alpha and beta Production-readiness Depends on your risk toleranc

Skybase is an extremely fast, secure and reliable real-time NoSQL database with automated snapshots and SSL
Skybase is an extremely fast, secure and reliable real-time NoSQL database with automated snapshots and SSL

Skybase The next-generation NoSQL database What is Skybase? Skybase (or SkybaseDB/SDB) is an effort to provide the best of key/value stores, document

Distributed transactional key-value database, originally created to complement TiDB
Distributed transactional key-value database, originally created to complement TiDB

Website | Documentation | Community Chat TiKV is an open-source, distributed, and transactional key-value database. Unlike other traditional NoSQL sys

small distributed database protocol

clepsydra Overview This is a work-in-progress implementation of a core protocol for a minimalist distributed database. It strives to be as small and s

A user crud written in Rust, designed to connect to a MySQL database with full integration test coverage.

SQLX User CRUD Purpose This application demonstrates the how to implement a common design for CRUDs in, potentially, a system of microservices. The de

Rust version of the Haskell ERD tool. Translates a plain text description of a relational database schema to dot files representing an entity relation diagram.

erd-rs Rust CLI tool for creating entity-relationship diagrams from plain text markup. Based on erd (uses the same input format and output rendering).

AgateDB is an embeddable, persistent and fast key-value (KV) database written in pure Rust

AgateDB is an embeddable, persistent and fast key-value (KV) database written in pure Rust. It is designed as an experimental engine for the TiKV project, and will bring aggressive optimizations for TiKV specifically.

Comments
  • Feature requests: Change Streams and File I/O Abstraction

    Feature requests: Change Streams and File I/O Abstraction

    Hello, I didn't see a better way to create a feature request, so I created this issue. I have 2 feature requests:

    1. Change Streams: Active queries, or queries that report new items (sorting can be disallowed on these queries) if the database adds, updates (old and new reported), or removes something that would have been included in a result set. This could also, just be a notification (callback or Stream entry) that the result set might have changed.
    2. File I/O should be a trait that is optionally passed in when opening the database. This allows storage in environments where storage is available, but the std library isn't implemented (embedded systems, wasm, etc.), and it could also be used to allow encryption to be added external to the database library.
    opened by Type1J 2
Owner
Tilman Roeder
Physics, Maths and Programming. I study computer science at Imperial College London. Languages I like include JavaScript, C, Rust, OCaml, Go, Python, and Ruby.
Tilman Roeder
A Distributed SQL Database - Building the Database in the Public to Learn Database Internals

Table of Contents Overview Usage TODO MVCC in entangleDB SQL Query Execution in entangleDB entangleDB Raft Consensus Engine What I am trying to build

Sarthak Dalabehera 38 Jan 2, 2024
A scalable, distributed, collaborative, document-graph database, for the realtime web

is the ultimate cloud database for tomorrow's applications Develop easier. Build faster. Scale quicker. What is SurrealDB? SurrealDB is an end-to-end

SurrealDB 16.9k Jan 8, 2023
Scalable and encrypted embedded database with 3-tier caching

Infinitree is a versioned, embedded database that uses uniform, encrypted blobs to store data.

Symmetree Research Labs 116 Dec 27, 2022
Embedded Distributed Encrypted Database (Research).

EDED Embedded Distributed Encrypted Database. Research projects to support ESSE. WIP Distributed design features Adapt to personal distributed usecase

Sun 2 Jan 6, 2022
Using embedded database modeled off SQLite - in Rust

Rust-SQLite (SQLRite) Rust-SQLite, aka SQLRite , is a simple embedded database modeled off SQLite, but developed with Rust. The goal is get a better u

Hand of Midas 3 May 19, 2023
A tiny embedded database built in Rust.

TinyBase TinyBase is an in-memory database built with Rust, based on the sled embedded key-value store. It supports indexing and constraints, allowing

Josh Rudnik 8 May 27, 2023
An embedded, in-memory, immutable, copy-on-write, key-value database engine

An embedded, in-memory, immutable, copy-on-write, key-value database engine. Features In-memory database Multi-version concurrency control Rich transa

SurrealDB 7 May 5, 2024
Simple, async embedded Rust

Cntrlr - Simple, asynchronous embedded Cntrlr is an all-in-one embedded platform for writing simple asynchronous applications on top of common hobbyis

Branan Riley 11 Jun 3, 2021
RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.

RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.

Qovery 145 Nov 23, 2022
Sled - the champagne of beta embedded databases

key value buy a coffee for us to convert into databases documentation chat about databases with us sled - it's all downhill from here!!! An embedded d

Tyler Neely 6.6k Jan 8, 2023