P2P Decentralized Key-Value Database with Bluetooth Low Energy Support for Hostile Network Conditions
Built for reliability, scalability, and resilience in challenging network environments
Decentralized peer-to-peer communication using TCP/GossipSub for reliable data synchronization across nodes.
BLE device discovery and scanning for mesh-like communication without traditional network infrastructure.
Built in Rust with RocksDB storage engine for fast, persistent key-value operations.
Designed for hostile network conditions with automatic peer discovery and connection recovery.
Dual transport layer using both TCP/IP and Bluetooth for maximum connectivity and resilience.
Simple HTTP REST API for easy integration with existing applications and services.
Built with modern, reliable technologies
Memory-safe systems programming
High-performance storage engine
Modular P2P networking stack
Cross-platform Bluetooth LE
Mesh networking protocol
Async runtime for Rust
Get TrainDB running in minutes
# Clone and build
git clone https://github.com/abhiraj-mengade/train-db.git
cd train-db
cargo build --features bluetooth --release
# Start first node with API
./target/release/train-db --db-path ./node1 start-with-api \
--node-port 4001 --api-port 8001
# Start second node
./target/release/train-db --db-path ./node2 start-with-api \
--node-port 4002 --api-port 8002 \
--bootstrap /ip4/127.0.0.1/tcp/4001
# Use the REST API
curl -X POST "http://localhost:8001/api/keys" \
-H "Content-Type: application/json" \
-d '{"key": "hello", "value": "world"}'
curl "http://localhost:8001/api/keys"
Follow these simple steps to set up TrainDB
Make sure you have Rust installed on your system. Visit rustup.rs for installation instructions.
Clone the repository and build TrainDB with Bluetooth support using Cargo.
Launch multiple TrainDB nodes and connect them to form a decentralized network.
Interact with your distributed database using the simple REST API endpoints.