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)
- Open up two terminal windows and navigate to
/Project3/src/main/java
- In one window, type
javac coordinator/*.java participant/*.java utils/*.java main/ServerMain.java
(hit ↩), followed byjava main.ServerMain
(hit ↩) - The servers are now running
- In the other window, type
javac client/*.java utils/*.java main/ClientMain.java
(hit ↩), followed byjava main.ClientMain
(hit ↩) - The client is now running
- The predefined protocol is:
PUT:key:value
(hit ↩)GET:key
(hit ↩)DELETE:key
(hit ↩)
- To shut down the application, type
stop
(hit ↩) orshutdown
(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.