A lightweight Redis client written in C++ that communicates with the official Redis server using the RESP2 (Redis Serialization Protocol).
This project demonstrates low-level socket programming, command parsing, and protocol implementation.
✅ Connects to official Redis server using TCP sockets
✅ Implements RESP2 protocol for communication
✅ Command parsing using Regex
✅ Handles server responses dynamically
✅ Automated build using Makefile
✅ Interactive CLI for sending Redis commands
The client follows a structured workflow:
User Input ↓ Command Handler ↓ Build RESP Command ↓ Send Command via Socket ↓ Response Handler ↓ Display Output
- Creates a TCP socket.
- Connects to the Redis server using IP and port.
- Establishes communication channel.
- Takes input commands from user.
- Uses Regex library to validate and parse commands.
- Converts command into structured tokens.
- Converts user command into RESP2 format.
- Example conversion:
SET key value
*3 $3 SET $3 key $5 value
- Sends formatted RESP command to Redis server through socket.
- Reads Redis server response.
- Parses different RESP response types:
- Simple Strings
- Errors
- Integers
- Bulk Strings
- Arrays
- Converts server response into readable output for user.
- C++
- Socket Programming (POSIX)
- Regex Library
- RESP2 Protocol
- Makefile