A Redis clone built in Rust, inspired by the Build Your Own Redis challenge by CodeCrafters.
This project implements key Redis functionalities, including RESP parsing, in-memory data storage, key expiration, RDB file loading, and multi-client handling using asynchronous I/O.
- RESP (Redis Serialization Protocol) serialization & deserializer
- TCP server handling multiple concurrent clients
- Asynchronous I/O using Tokio
- Basic Redis command support:
PING,SET,GET,CONFIG,KEYS - Passive key expiration
- RDB file parsing and in-memory data loading
git clone https://github.com/Yassen-Higazi/redis-rust.git
cd redis-rustcargo buildcargo runcargo run -- -d ./dataThis will parse the dump.rdb file in the ./data directory and populate the in-memory store on startup.
redis-cli ping
PONGredis-cli keys *
1) "test2"
2) "test1"
3) "test3"redis-cli set api_key test_api_key
OKredis-cli get api_key
"test_api_key"redis-cli get test1
"test"redis-cli get test
(nil)redis-cli config get dir
1) "dir"
2) "data"This project is licensed under the MIT License. See the LICENSE file for details.