Brownis is a lightweight Redis-compatible server implementation written in Go. It supports basic Redis commands and core functionality like the Redis Serialization Protocol (RESP) and replication.
- RESP Protocol: Full support for Redis Serialization Protocol for communication.
- Key-Value Store: In-memory storage for strings with optional expiry.
- Replication: Supports Master/Replica configuration with handshake and command propagation.
- Multi-client support: Handles multiple concurrent client connections.
PING: Check server availability.ECHO: Returns the input string.SET: Store a key-value pair. SupportsPXfor millisecond-level expiry.GET: Retrieve the value of a key.INFO: Get server information (replication role, IDs, etc.).
- Go 1.25 or higher
To start the server on the default port (6379):
go run app/*.goTo start on a custom port:
go run app/*.go --port 6380To start as a replica of another server:
go run app/*.go --port 6381 --replicaof "127.0.0.1 6379"- Concurrency: Each connection is handled in a separate goroutine.
- Replication: Master nodes propagate
SETcommands to all connected replicas. - Expiry: Values stored with
PXare automatically expired duringGETrequests.