| Crates.io | oxirs-cluster |
| lib.rs | oxirs-cluster |
| version | 0.1.0 |
| created_at | 2025-09-30 08:42:32.134012+00 |
| updated_at | 2026-01-20 21:31:24.942013+00 |
| description | Raft-backed distributed dataset for high availability and horizontal scaling |
| homepage | https://github.com/cool-japan/oxirs |
| repository | https://github.com/cool-japan/oxirs |
| max_upload_size | |
| id | 1860806 |
| size | 2,630,958 |
Status: Production Release (v0.1.0) - Released January 7, 2026
✨ Production Release: Production-ready with API stability guarantees and comprehensive testing.
A high-performance, distributed RDF storage system using Raft consensus for horizontal scaling and fault tolerance. Part of the OxiRS ecosystem providing a JVM-free alternative to Apache Jena + Fuseki with enhanced clustering capabilities.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Node A │ │ Node B │ │ Node C │
│ (Leader) │ │ (Follower) │ │ (Follower) │
├─────────────────┤ ├─────────────────┤ ├─────────────────┤
│ Raft Consensus │◄─┤ Raft Consensus │◄─┤ Raft Consensus │
│ RDF Storage │ │ RDF Storage │ │ RDF Storage │
│ Query Engine │ │ Query Engine │ │ Query Engine │
│ Network Layer │ │ Network Layer │ │ Network Layer │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Add to your Cargo.toml:
# Experimental feature
[dependencies]
oxirs-cluster = "0.1.0"
use oxirs_cluster::{Cluster, ClusterConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize cluster configuration
let config = ClusterConfig::builder()
.node_id("node-1")
.bind_address("127.0.0.1:8080")
.peers(vec!["127.0.0.1:8081", "127.0.0.1:8082"])
.data_dir("./data")
.build()?;
// Start cluster node
let cluster = Cluster::new(config).await?;
cluster.start().await?;
// Insert RDF data
cluster.insert_triple("http://example.org/alice",
"http://example.org/knows",
"http://example.org/bob").await?;
// Execute SPARQL query
let results = cluster.query("SELECT ?s ?p ?o WHERE { ?s ?p ?o }").await?;
println!("Results: {:?}", results);
Ok(())
}
# Start first node (bootstrap)
cargo run --bin oxirs-cluster -- \
--node-id node-1 \
--bind 127.0.0.1:8080 \
--data-dir ./data/node1 \
--bootstrap
# Start second node
cargo run --bin oxirs-cluster -- \
--node-id node-2 \
--bind 127.0.0.1:8081 \
--data-dir ./data/node2 \
--join 127.0.0.1:8080
# Start third node
cargo run --bin oxirs-cluster -- \
--node-id node-3 \
--bind 127.0.0.1:8082 \
--data-dir ./data/node3 \
--join 127.0.0.1:8080
OXIRS_CLUSTER_NODE_ID=node-1
OXIRS_CLUSTER_BIND_ADDR=0.0.0.0:8080
OXIRS_CLUSTER_DATA_DIR=/var/lib/oxirs
OXIRS_CLUSTER_LOG_LEVEL=info
OXIRS_CLUSTER_HEARTBEAT_INTERVAL=150ms
OXIRS_CLUSTER_ELECTION_TIMEOUT=1500ms
[cluster]
node_id = "node-1"
bind_address = "0.0.0.0:8080"
data_dir = "/var/lib/oxirs"
[raft]
heartbeat_interval = "150ms"
election_timeout = "1500ms"
max_log_entries = 10000
snapshot_threshold = 5000
[storage]
partition_count = 16
replication_factor = 3
compression = "lz4"
[network]
max_connections = 1000
connection_timeout = "30s"
message_timeout = "5s"
let config = ClusterConfig::builder()
.node_id("node-1")
.heartbeat_interval(Duration::from_millis(150))
.election_timeout(Duration::from_millis(1500))
.max_log_entries(10000)
.snapshot_threshold(5000)
.build()?;
The cluster exposes Prometheus-compatible metrics:
oxirs_cluster_nodes_total: Total number of cluster nodesoxirs_cluster_leader_changes_total: Number of leader changesoxirs_cluster_queries_total: Total queries processedoxirs_cluster_query_duration_seconds: Query latency histogramoxirs_cluster_replication_lag_seconds: Replication lag# Check cluster health
curl http://localhost:8080/health
# Check node status
curl http://localhost:8080/status
# Get cluster metrics
curl http://localhost:8080/metrics
# Build with all features
cargo build --all-features
# Run tests
cargo nextest run --no-fail-fast
# Run benchmarks
cargo bench
# Unit tests
cargo test
# Integration tests
cargo test --test integration
# Chaos engineering tests
cargo test --test chaos
git checkout -b feature/amazing-feature)cargo nextest run --no-fail-fast)cargo clippy --workspace --all-targets -- -D warnings)cargo fmt --all)git commit -am 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
For more information, see the OxiRS documentation and TODO.md for detailed implementation progress.