Skip to content

VarunSai-DVS/Distributed-Key-Value-Store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key-Value Store System

This project implements a simple key-value store using both TCP and UDP communication protocols. The system consists of a client and server for each protocol, allowing users to interact with the key-value store by performing get, put, and delete operations.

The TCP Client communicates with the TCP Server and the UDP Client communicates with the UDP Server.


Running the Server

Starting the UDP Server

To start the UDP-based key-value store server, run the following command:

Navigate to src/server on a terminal

java ServerUDP.java <Port Number>

Example:

java ServerUDP.java 8080

Starting the TCP Server

To start the TCP-based key-value store server, run the following command:

java ServerTCP.java <Port Number>

Example:

java ServerTCP.java 8081

Running the Client

Starting the UDP Client

To start the UDP client and connect to a key-value store server, use the following command:

Navigate to src/client

java ClientUDP.java <HostName> <PortNumber>

Example:

java ClientUDP.java localhost 8080

Starting the TCP Client

To start the TCP client and connect to a key-value store server, use the following command:

java ClientTCP.java <HostName> <PortNumber>

Example:

java ClientTCP.java localhost 8081

How the System Works

Once the client connects to the server, it will prompt the user to choose an operation:

  • get <key>: Retrieves the value associated with a given key.
  • put <key> <value>: Stores a key-value pair in the server.
  • delete <key>: Removes a key-value pair from the server.
  • exit: Terminates the client connection.

The server processes each request and returns the appropriate response to the client.


Notes

  • Ensure that the server is running before starting the client.
  • The server must listen on the specified port to accept connections.
  • The system supports both TCP and UDP communication for flexibility.
  • Use localhost as the host when running locally.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages