A lightweight in-memory database written in Go that replicates basic Redis behavior. This server supports several core Redis commands and provides append-only persistence using a mutex to ensure thread safety.
- ๐ง In-memory key-value store
- ๐พ Append-Only File (AOF) persistence
- ๐ Mutex-protected concurrent writes
- ๐ฏ Redis-compatible command interface
- ๐ ๏ธ Supports basic string and hash operations
- ๐ก Listens on the default Redis port:
6379
| Command | Description | Usage |
|---|---|---|
PING |
Health check (returns PONG) |
PING [message] |
SET |
Sets a string key | SET key val |
GET |
Gets a string value | GET key |
HSET |
Sets a field in a hash | HSET key field1 val1 [field2 val2 ...] |
HGET |
Gets a field value in a hash | HGET key field |
HGETALL |
Gets all fields/values in hash | HGETALL key |
- Clone the repository:
git clone https://github.com/boinkkitty/go-redis.git
- Run the server:
cd go-redis make server
- Run client:
make client