A Redis-compatible in-memory server implemented in Java 25 and Spring Boot.
- RESP TCP protocol parsing and serialization
PING,SET,GET,ECHO, andINCRcommands- Key expiration with
PX - Transactions with
MULTI,EXEC, andDISCARD - Master-replica handshake and command propagation
WAIT,PSYNC, andREPLCONFreplication flows- Concurrent in-memory storage protected by read/write locking
- Unit tests for protocol, storage, transaction, client, and replication configuration behavior
- Java 25 LTS
- Maven 3.9+
$env:JAVA_HOME = "C:\Users\usr\.jdks\jdk-25.0.2"
$env:Path = "$env:JAVA_HOME\bin;C:\Users\usr\.maven\maven-3.9.16\bin;$env:Path"
mvn clean test
mvn -B package -DskipTests -Ddir=target\demoThe packaged application is written to target\demo\jedis.jar.
java -jar target\demo\jedis.jar --port 6379Run the visual TCP/RESP demonstration in a second terminal:
powershell -NoProfile -ExecutionPolicy Bypass -File .\demo.ps1 -Port 6379See test.md for the complete presentation workflow and INTERVIEW_PREPARATION.md for the architecture walkthrough and interview questions.
The project includes a GitHub Actions workflow that tests with Java 25, publishes the Docker image to GHCR, and deploys the image to Kubernetes with Helm. See DEPLOYMENT.md for cluster setup, the KUBE_CONFIG secret, and verification commands.
Maincreates the Spring context and selects master or replica mode.MasterTcpServeraccepts TCP clients and dispatches commands.RespSerializerparses RESP requests and formats responses.CommandHandlerimplements command behavior.Storemanages values, expiry, locking, and transaction application.SlaveTcpServerhandles replica synchronization.
docker build -t jedis .
docker run -p 6379:6379 jedis