# OrientDB
```text
┌─────────┐
│ Node A │
└────┬────┘
│
┌────┴────┬────────┬────────┐
│ │ │ │
┌───▼───┐ ┌──▼───┐ ┌──▼───┐ ┌──▼───┐
│Node B │ │Node C│ │Node D│ │Node E│
└───┬───┘ └──┬───┘ └──────┘ └──┬───┘
│ │ │
┌───▼───┐ ┌──▼───┐ ┌──▼───┐
│Node F │ │Node G│ │Node H│
└───────┘ └──────┘ └──────┘
```
## Overview
**OrientDB** is a simple, lightweight in-memory graph database library built with Rust. Designed with minimalism in mind, it provides a clean and efficient API for managing graph data structures without the overhead of traditional database systems.
## Features
- **In-Memory Storage**: Lightning-fast access to graph data stored entirely in memory
- **Minimal Design**: Simple, intuitive API with zero bloat
- **Optimized Tree Search**: Implements fast algorithms for efficient tree traversal and search operations
- **Pure Rust**: Written entirely in Rust for safety, performance, and reliability
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
orientdb = "0.1.1"
```
## Quick Start
```rust
use orientdb::SimpleGraph;
fn main() {
let mut graph = SimpleGraph::new();
let tokyo = graph.add_node("Tokyo");
let kyoto = graph.add_node("Kyoto");
let osaka = graph.add_node("Osaka");
graph.add_edge(tokyo, kyoto);
graph.add_edge(kyoto, osaka);
println!("Stored {} cities in the graph.", graph.node_count());
if let Some(neighbors) = graph.neighbors(tokyo) {
for &neighbor_id in neighbors {
if let Some(&city) = graph.get_node(neighbor_id) {
println!("Tokyo connects to {city}.");
}
}
}
}
```
## Examples
```bash
cargo run --example basic
```
```bash
cargo run --example find
```
## Performance
OrientDB is optimized for scenarios where:
- Data fits entirely in memory
- Fast read/write operations are critical
- Minimal overhead is required
- Tree search performance is a priority
## License
MIT