Rusty-Redis is a learning-focused reimplementation of the Redis in-memory data structure store, built entirely in Rust. This project aims to explore and demonstrate the internals of Redis while leveraging Rust's powerful features for safety and concurrency.
- Full reimplementation of Redis in Rust.
- Support for core Redis data structures: strings, lists, sets, hashes, and sorted sets.
- Learning-focused codebase with clear and concise implementations.
- Basic networking for handling client connections and message encoding/decoding.
- Simple persistence mechanisms for learning purposes.
- Examples and documentation to aid in understanding Redis and Rust.
- Handles startup, shutdown, and main event loop.
- Manages client connections and command processing.
- Manages TCP connections.
- Implements RESP for message encoding/decoding.
- Implements core data structures: strings, lists, sets, hashes, sorted sets.
- Implements logic for Redis commands (e.g.,
GET
,SET
,LPUSH
,SADD
). - Maps commands to data structure operations.
- Manages data persistence (RDB snapshots, AOF).
- Handles saving/loading data to/from disk.
- Implements publish/subscribe system.
- Manages channels and message distribution.
- Supports Redis transactions with
MULTI/EXEC
. - Ensures atomic command execution.
- Provides Lua scripting support.
- Handles script execution and integration.
- Implements logging for events, errors, and commands.
- Collects server performance metrics.
- Manages server configuration options.
- Loads and validates configurations.
- Provides utility functions and helpers.
- Includes error handling, data encoding/decoding.
rusty-redis/
├── src/
│ ├── main.rs // Entry point of the application
│ ├── server.rs // Server management
│ ├── networking.rs // Networking module
│ ├── data_structures/ // Core data structures
│ │ ├── strings.rs
│ │ ├── lists.rs
│ │ ├── sets.rs
│ │ ├── hashes.rs
│ │ └── sorted_sets.rs
│ ├── commands.rs // Command handling
│ ├── storage.rs // Persistence mechanisms
│ ├── pubsub.rs // Pub/Sub system
│ ├── transactions.rs // Transaction support
│ ├── scripting.rs // Lua scripting
│ ├── logging.rs // Logging and metrics
│ ├── configuration.rs // Configuration management
│ └── utils.rs // Utility functions and helpers
├── Cargo.toml // Project dependencies and metadata
└── README.md // Project description and documentation