A lightweight Redis-compatible server implementation in Go, supporting core Redis functionality and persistence.
- RESP (Redis Serialization Protocol) implementation for Redis compatibility
- Basic Redis commands support:
PING
- Test server connectivityECHO
- Echo back the inputSET
- Set key-value pairs with optional expirationGET
- Retrieve values by keyHSET
- Set hash map entriesHGET
- Retrieve hash map valuesKEYS
- Pattern-based key search
- Persistence through Append-Only File (AOF) and automatic AOF recovery on server restart
- Supports Key expiration
- Supports concurrent connections while ensuring thread-safe operations
- Go 1.16 or higher
git clone https://github.com/ashish-kamra/redis-clone.git
cd redis-clone
go build ./cmd/server
./server -port 6379
The server will start listening on the specified port (default: 6379).
You can connect to the server using any Redis client. For example, using redis-cli
:
redis-cli -p 6379