Compile the server and client code:
javac *.java
Start the server with the desired port number (e.g., 1234):
java KeyValueStoreImpl 1234
The server will start and display logs indicating its status.
Run the client with the server's IP address and port number:
java KeyValueClient localhost 1234
You can choose to pre-populate values or skip.
Enter yes
if you want the store to be pre-populated with 5 key-value pairs.
Follow the prompts to interact with the key-value store: Enter commands like PUT, GET, DELETE along with key-value pairs.
PUT <key> <Value>
GET <key> <Value>
DELETE <key> <Value>
The purpose of this project is to implement a key-value store using Java RMI (Remote Method Invocation) for communication between a client and a server. The scope includes developing server and client programs that allow operations like PUT, GET, and DELETE on key-value pairs stored in a HashMap on the server side. The assignment emphasizes understanding RMI communication, handling client-server interactions, implementing basic error handling and logging mechanisms, as well as dealing with concurrency when multiple users access the key-value store simultaneously.
I gained hands-on experience with Java RMI, which provided insights into distributed computing paradigms and remote procedure calls. Implementing the server to handle concurrent client requests using multi-threading and ensuring thread safety added depth to my understanding of concurrent programming in Java. Each client request is processed in a separate thread, allowing multiple users to access the key-value store concurrently without blocking other requests. Handling communication protocols, such as PUT, GET, and DELETE, required careful consideration of data serialization and deserialization within a multi-threaded environment. Overall, the assignment enhanced my skills in network programming, error handling, logging practices, and concurrent programming concepts in Java applications. However, I found areas for improvement in refining the user experience, such as providing more detailed error messages and enhancing command-line interface interactions for the client program.
Screenshot showing prepopulated key-value pairs in the key-value store.
Description: Screenshot of server logs displaying requests received and responses sent.
Description: Screenshot of client logs showing interactions with the key-value store.