A production-ready, high-performance key-value store written in Rust with advanced features including transactions, multiple serialization formats, and comprehensive CLI tools.
- High Performance: Optimized for speed with multiple storage backends
- Transaction Support: ACID-compliant transactions with rollback capabilities
- Multiple Serialization Formats: JSON, Bincode, and MessagePack support
- Flexible Storage: In-memory and persistent file-based storage
- Comprehensive CLI: Full-featured command-line interface with interactive mode
- Configuration Management: TOML config files and environment variable support
- Structured Logging: Built-in logging with configurable levels
- Import/Export: JSON import/export functionality
- Backup & Restore: Built-in backup and restore capabilities
- Cross-Platform: Works on Windows, macOS, and Linux
git clone https://github.com/naimjeem/rustore.git
cd rustore
cargo build --releasecargo install rustore
# Set a key-value pair rustore set mykey "Hello, World!" # Get a value rustore get mykey # Delete a key rustore delete mykey # List all keys rustore list # Show database statistics rustore stats
rustore interactive
# Use JSON format rustore --format json set key "value" # Use MessagePack format rustore --format msgpack set key "value"
Create a rustore.toml file:
database_path = "my_database.db" serialization_format = "bincode" # json, bincode, msgpack compression = false cache_size_mb = 100 wal_enabled = true sync_frequency = 30 indexing_enabled = true log_level = "info"
export RUSTORE_DB_PATH="/path/to/database.db" export RUSTORE_FORMAT="json" export RUSTORE_CACHE_SIZE="200" export RUST_LOG="debug"
set <key> <value>- Set a key-value pairget <key>- Get a value by keydelete <key>- Delete a keyexists <key>- Check if key existslist- List all keyslist-all- List all key-value pairsstats- Show database statistics
interactive- Start interactive sessionimport <file>- Import from JSON fileexport <file>- Export to JSON filecompact- Compact the databasebackup <file>- Create backuprestore <file>- Restore from backup
--database, -d <path>- Database file path (default: rustore.db)--config, -c <path>- Configuration file path--format, -f <format>- Serialization format (json, bincode, msgpack)--verbose, -v- Enable verbose logging
use rustore::{Database, Config}; // Create a new database let config = Config::default(); let db = Database::new(config)?; // Basic operations db.set("key", "value")?; let value = db.get("key")?; db.delete("key")?; // Transactions let tx_id = db.begin_transaction()?; db.set_in_transaction(tx_id, "key", "value")?; db.commit_transaction(tx_id)?; // Statistics let stats = db.stats()?; println!("{}", stats);
Rustore is designed for high performance:
- Memory Storage: Sub-microsecond operations
- File Storage: Optimized for concurrent access
- Serialization: Multiple formats optimized for different use cases
- Transactions: Efficient transaction management
Run benchmarks:
cargo bench
# Run all tests cargo test # Run integration tests cargo test --test integration_tests # Run with coverage cargo test --features coverage
Contributions are welcome! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG.md for a list of changes and version history.
- π§ Email: naim36208@gmail.com
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- Distributed storage support
- REST API server
- WebSocket support
- Advanced indexing
- Compression support
- Encryption at rest
- Replication
- Clustering support
Made with β€οΈ by Naim Jeem