A lightweight, concurrent distributed key-value database built from scratch in Java 21. Designed with a modular architecture, custom TCP networking, and high-performance Java 21 Virtual Threads to handle concurrent client connections efficiently.
- Storage Engine: An in-memory, thread-safe storage engine powered by Java's
ConcurrentHashMapsupporting core commands:SET,GET, andDEL. - Custom TCP Server: Listens on configurable ports and utilizes Java 21 Virtual Threads (
Thread.ofVirtual()) to scale connection handling seamlessly. - Consensus Scaffolding: Modular directory layout prepared for distributed log replication and Raft consensus integration.
java-distributed-datastore/
│
├── src/main/java/com/distributed/
│ ├── Main.java # Entry point / Node bootstrapper
│ ├── storage/
│ │ └── StorageEngine.java # In-memory thread-safe key-value store
│ ├── server/
│ │ └── NetworkServer.java # TCP socket server using Virtual Threads
│ └── consensus/
│ ├── RaftNode.java # Consensus state machine skeleton
│ └── RaftLog.java # Replicated log structures
│
├── pom.xml # Project build configuration
└── .gitignore # Ignored build artifacts