ruvector-replication
Multi-master vector replication with quorum writes, vector clocks, and automatic conflict resolution.
= "0.1.1"
When your vector database runs on more than one node, you need a way to keep data in sync without losing writes or slowing down queries. ruvector-replication handles that: it replicates vectors across nodes, resolves conflicts automatically, and lets you trade off consistency versus speed per-write. It plugs into the RuVector ecosystem alongside Raft consensus and auto-sharding.
| Single-node vector DB | ruvector-replication | |
|---|---|---|
| Availability | One node goes down, everything stops | Replicas serve reads and accept writes |
| Write scaling | One writer | Multi-master -- write to any node |
| Conflict handling | N/A | Vector clocks, last-write-wins, or CRDTs |
| Consistency control | N/A | Per-write: One, Quorum, or All |
| Sync efficiency | N/A | Incremental deltas with compression |
| Recovery | Manual restore from backup | Automatic replica recovery |
Quick Start
use ;
async
Key Features
| Feature | What It Does | Why It Matters |
|---|---|---|
| Multi-master replication | Write to any node in the cluster | No single point of failure for writes |
| Configurable consistency | Choose One, Quorum, or All per write | Trade latency for safety on a per-operation basis |
| Vector clock conflict resolution | Track causal ordering across nodes | Detect and resolve concurrent writes correctly |
| CRDT support | Conflict-free replicated data types | Guaranteed convergence without coordination |
| Change streams | Real-time replication event stream | Monitor sync status and react to changes |
| Incremental sync with compression | Only send deltas, compressed on the wire | Minimize bandwidth between nodes |
| Automatic recovery | Replicas catch up after failures | No manual intervention on node restart |
| Bandwidth throttling | Cap replication throughput | Protect production traffic from replication storms |
Write with Replication
use ;
// Write with quorum consistency
let options = WriteOptions ;
replicator.write.await?;
// Write with eventual consistency (faster)
let options = WriteOptions ;
replicator.write.await?;
Monitor Replication
// Get replication lag
let lag = replicator.lag.await?;
println!;
// Get replica status
for replica in replicator.replicas.await?
// Subscribe to replication events
let mut stream = replicator.events.await?;
while let Some = stream.next.await
API Overview
Core Types
// Replication configuration
// Consistency levels
// Conflict resolution strategies
// Replica information
Replicator Operations
Architecture
┌─────────────────────────────────────────────────────────┐
│ Replication Flow │
│ │
│ Client │
│ │ │
│ ▼ │
│ ┌──────────┐ Quorum Write ┌──────────┐ │
│ │ Primary │────────────────────▶│ Replica 1│ │
│ │ │ │ │ │
│ │ Vectors │────────────────────▶│ Vectors │ │
│ └──────────┘ └──────────┘ │
│ │ │
│ │ Async Replication │
│ └──────────────────────────▶┌──────────┐ │
│ │ Replica 2│ │
│ │ │ │
│ │ Vectors │ │
│ └──────────┘ │
└─────────────────────────────────────────────────────────┘
Related Crates
- ruvector-core - Core vector database engine
- ruvector-cluster - Clustering and sharding
- ruvector-raft - Raft consensus
Documentation
- Main README - Complete project overview
- API Documentation - Full API reference
- GitHub Repository - Source code
License
MIT License - see LICENSE for details.