Skip to content

This project replicates a key-value store across 5 distinct servers to increase bandwidth and ensure availability.

Notifications You must be signed in to change notification settings

riccardoprosdocimi/multiple-multi-threaded-key-value-stores

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Multiple multi-threaded key-value stores (RPC/RMI)

This project replicates a key-value store across 5 distinct servers to increase bandwidth and ensure availability.

It's set up to allow multiple concurrent clients to communicate with any of the servers and perform three basic operations:

  • PUT(key, value)
  • GET(key)
  • DELETE(key)

Usage (locally):

  1. Open up two terminal windows and navigate to /Project3/src/main/java
  2. In one window, type javac coordinator/*.java participant/*.java utils/*.java main/ServerMain.java (hit ), followed by java main.ServerMain (hit )
  3. The servers are now running
  4. In the other window, type javac client/*.java utils/*.java main/ClientMain.java (hit ), followed by java main.ClientMain (hit )
  5. The client is now running
  6. The predefined protocol is:
    • PUT:key:value(hit )
    • GET:key(hit )
    • DELETE:key(hit )
  7. To shut down the application, type stop(hit ) or shutdown(hit )

SIDE NOTES
  • Each participant has a private method that generates a random number from 0 to 100 and, if the number generated is equal to 23, it aborts the transaction.
  • Other abort cases are the following:
    • A client tries to delete a nonexistent key.
    • A client tries to add an already existent key.
  • At boot up, a client connects to a participant at random.