
π§π§π§ Please note that this is work in progress, so while a lot of things have settled by now, we still favour breaking backwards compatiblity for seeminly minor improvements. π§π§π§
About
βInsufficient facts always invite danger.β
β Mr. Spock
Trible Space is a data space and knowledge graph standard. It offers metadata management capabilities similar to file- and version-control systems, combined with the queryability and convenience of an embedded database, tailored towards use with simple blob storage. It is designed to be a holistic yet lightweight data storage solution that can be used in a variety of contexts, from embedded systems to distributed cloud services.
Our goal is to re-invent data storage from first principles and overcome the shortcomings of prior "Semantic Web"/triple-store technologies. By focusing on simplicity, canonical data formats, cryptographic identifiers, and clean distributed semantics, we aim to provide a lean, lightweight yet powerful toolkit for knowledge representation, database management, and data exchange use cases.
Features
- Lean, Lightweight & Flexible: Data storage seamlessly scales from in-memory data organization to large-scale blob and metadata storage on S3 like services.
- Distributed: Eventually consistent CRDT semantics (based on the CALM principle), compressed zero-copy archives, and built-in version control.
- Predictable Performance: An optimizer-free design using novel algorithms and data structures removes the need for manual query-tuning and enables single-digit microsecond latency.
- Fast In-Memory Datasets: Enjoy cheap copy-on-write (COW) semantics and speedy set operations, allowing you to treat entire datasets as values.
- Compile-Time Typed Queries: Automatic type inference, type-checking, and auto-completion make writing queries a breeze. You can even create queries that span multiple datasets and native Rust data structures.
- Low Overall Complexity: We aim for a design that feels obvious (in the best way) and makes good use of existing language facilities. A serverless design makes it completely self-sufficient for local use and requires only an S3-compatible service for distribution.
- Easy Implementation: The spec is designed to be friendly to high- and low-level languages, or even hardware implementations.
- Lock-Free Blob Writes: Blob data is appended with a single
O_APPENDwrite. Each handle advances an in-memoryapplied_lengthonly if no other writer has appended in between, scanning any gap to ingest missing records. Concurrent writers may duplicate blobs, but hashes guarantee consistency. Updating branch heads uses a shortflush β refresh β lock β refresh β append β unlocksequence. - Coordinated Refresh:
refreshacquires a shared file lock while scanning to avoid races withrestoretruncating the pile.
Community
If you have any questions or want to chat about graph databases hop into our discord.
Getting Started
Add the crate to your project:
Once the crate is installed, you can experiment immediately with the quick-start program below. It showcases the attribute macros, workspace staging, queries, and pushing commits to a repository.
use SigningKey;
use OsRng;
use *;
use LongString;
use ;
The Getting Started chapter of the book breaks this example down line by line, covers project scaffolding, and introduces more background on how repositories, workspaces, and queries interact.
Tribles Book
For a step-by-step narrative guide, see the Tribles Book.
To build the HTML locally, first install mdbook with cargo install mdbook
and then run:
For details on setting up a development environment, see Developing Locally.
Learn More
The best way to get started is to read the Tribles Book. The following links mirror the book's chapter order so you can progress from the basics to more advanced topics:
- Introduction
- Getting Started
- Architecture
- Query Language
- Incremental Queries
- Schemas
- Repository Workflows
- Commit Selectors
- Philosophy
- Identifiers
- Trible Structure
- Pile Format
License
Licensed under either of
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.