chrido / i13kv

A tiny key value store demonstrating various socket handling techniques

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#I13 KV

Build status

The goal of I13 Key Value Store is to teach various socket handling techniques in Java. The only commands supported so far are PUT, GET, DELETE, EXISTS

Following socket handling techniques are implemented:

  • Java 7 NIO
  • Single threaded and blocking
  • One thread per connection
  • Threadpool

Install Java and Maven

Maven is optional. You only need it if you want to run the build and tests from commandline. You can use an IDE (Eclipse, IntelliJ IDEA)

Install Java 8

Tests

mvn test

Running

mvn assembly:assembly
java -jar target/niokv-jar-with-dependencies.jar

Connect via telnet (Linux)

Install telnet apt-get install telnet

user@machine: telnet
telnet> open localhost 5559
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
PUT turingawards 2013 LeslieLamport
GET turingawards 2013

Connect via telnet (Windows)

Install telnet client Windows + R, telnet, Enter

telnet> open localhost 5559
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
PUT turingawards 2013 LeslieLamport
GET turingawards 2013

Contributing

Pull requests welcome!

Ideas:

  • Additional operators (INC, FLUSHALL, ... more ideas, ...)
  • Reactive programming
  • Notifications
  • Persistence to disk
  • Client
  • HTTP interface
  • ...

About

A tiny key value store demonstrating various socket handling techniques


Languages

Language:Java 100.0%