Skip to content
Prateeks16Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

jedis

A Redis-compatible in-memory server implemented in Java 25 and Spring Boot.

Features

  • RESP TCP protocol parsing and serialization
  • PING, SET, GET, ECHO, and INCR commands
  • Key expiration with PX
  • Transactions with MULTI, EXEC, and DISCARD
  • Master-replica handshake and command propagation
  • WAIT, PSYNC, and REPLCONF replication flows
  • Concurrent in-memory storage protected by read/write locking
  • Unit tests for protocol, storage, transaction, client, and replication configuration behavior

Requirements

  • Java 25 LTS
  • Maven 3.9+

Build and Test

$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\demo

The packaged application is written to target\demo\jedis.jar.

Run

java -jar target\demo\jedis.jar --port 6379

Run the visual TCP/RESP demonstration in a second terminal:

powershell -NoProfile -ExecutionPolicy Bypass -File .\demo.ps1 -Port 6379

See test.md for the complete presentation workflow and INTERVIEW_PREPARATION.md for the architecture walkthrough and interview questions.

GitHub Actions Deployment

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.

Architecture

  • Main creates the Spring context and selects master or replica mode.
  • MasterTcpServer accepts TCP clients and dispatches commands.
  • RespSerializer parses RESP requests and formats responses.
  • CommandHandler implements command behavior.
  • Store manages values, expiry, locking, and transaction application.
  • SlaveTcpServer handles replica synchronization.

Container

docker build -t jedis .
docker run -p 6379:6379 jedis

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages