https://github.com/erickj3/redis-like-rust
A redis-like in rust 🦀
https://github.com/erickj3/redis-like-rust
database redis rust
Last synced: 5 months ago
JSON representation
A redis-like in rust 🦀
- Host: GitHub
- URL: https://github.com/erickj3/redis-like-rust
- Owner: ErickJ3
- Created: 2024-11-16T11:30:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-17T13:55:13.000Z (over 1 year ago)
- Last Synced: 2025-04-28T00:58:30.921Z (about 1 year ago)
- Topics: database, redis, rust
- Language: Rust
- Homepage:
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Redis-like Server
A lightweight Redis-like server implementation in Rust supporting basic key-value operations with optional expiration times. The server implements a subset of the RESP (Redis Serialization Protocol) and handles concurrent connections using Tokio.
## Features
- Basic Redis commands (PING, ECHO, GET, SET)
- Key expiration with PX option
- Thread-safe concurrent access
- RESP protocol support
- Automatic cleanup of expired keys
## Commands
### PING
Returns PONG. Used for connection testing.
```
> PING
< PONG
```
### ECHO
Returns the given message.
```
> ECHO message
< message
```
### SET
Stores a key-value pair, optionally with expiration time in milliseconds.
```
> SET key value
< OK
> SET key value PX 1000 # Expires after 1 second
< OK
```
### GET
Retrieves the value for a given key.
```
> GET key
< value
> GET nonexistent
< (nil)
```