A Redis server implementation in Go.
Godis is a lightweight Redis-like server written in Go. It implements the Redis Serialization Protocol (RESP) and provides a TCP server that can process Redis commands.
# Clone the repository
git clone https://github.com/yourusername/godis.git
# Navigate to the project directory
cd godis
# Build the project
go build# Run the server with default settings (127.0.0.1:8080)
./godis
# Run the server with custom host and port
./godis -h 0.0.0.0 -p 6379You can connect to the server using any Redis client, or use a simple TCP client like netcat:
nc 127.0.0.1 8080This project is in early development. The basic server structure is in place, but many features are not yet implemented.
- Fix bugs in the RESP decoder:
- Fix DecodeCommands function which currently always returns nil
- Fix panics
- Fix bug with INCR/DECR and SET
- Implement async server based on eventloop
- Add support for windows based on IOCP
- Implement RESP encoder for proper response formatting
- Implement command evaluation logic
- Add data storage functionality
- Implement basic Redis commands:
- GET
- SET
- DEL
- TTL
- INCR
- DECR
- EXPIRE
- Improve Naive Implementation of Delete & Expiry
- Add support for Eviction Policies
- LRU
- LFU
- Approximate LRU
- Random
- Incorporate design pattern for choosing eviction strategies.
- Add config file and refactor argument flags
- Add command chaining
- Add support for data types/structures:
- Strings
- Lists
- Sorted Sets
- Geo Hash
- HyperLogLog
- Improve Naive Implementation of Delete & Expiry
- Improve error handling
- Add integration tests
- Add benchmarking
- Add Redis CLI using Charm / Bubble Tea
- Add persistence options
- Add transactions
- Improve documentation
Contributions are welcome! Please feel free to submit issues.