KVS is a key-value store system, developed for our Operating Systems class. This project is divided into two parts, each implemented in a separate branch. The first part (kvs_server) focuses on creating a key-value store using a hash table, threads, and forks. The second part (main branch) extends the system to include client-server communication using named pipes building on top of the code in kvs_server.
- WRITE: Write one or more key-value pairs to the store.
- READ: Read the values of one or more keys from the store.
- DELETE: Delete one or more key-value pairs from the store.
- SHOW: Display all key-value pairs in the store.
- WAIT: Introduce a delay in the execution of commands.
- BACKUP: Create a backup of the current state of the store.
Example Commands:
WAIT 1000 WRITE [(d,dinis)(c,carlota)] READ [x,z,l,v] SHOW BACKUP DELETE [c]
- DELAY: Introduce a delay in the execution of commands.
- SUBSCRIBE: Subscribe to specific keys to receive notifications.
- UNSUBSCRIBE: Unsubscribe from specific keys.
- DISCONNECT: Disconnect the client from the server.
Example Commands:
DELAY 1000 SUBSCRIBE [a] UNSUBSCRIBE [a] DISCONNECT
To build the project, use the provided Makefile (in the src directory):
make
To run the server, use the following command (in the src/server directory):
./server/kvs <jobs_dir> <max_threads> <backups_max> <server_fifo_path>
<jobs_dir>
: Directory containing the job files.<max_threads>
: Maximum number of threads to process job files.<backups_max>
: Maximum number of concurrent backups.<server_fifo_path>
: Path to the server registration FIFO.
To run a client, use the following command (in the src/client directory):
./client/client <client_id> <server_fifo_path>
<client_id>
: Unique identifier for the client.<server_fifo_path>
: Path to the server registration FIFO.
Note
When running multiple clients use different client id's.
This project was developed for educational purposes as part of our Operating Systems class. The base code and materials were provided by our teacher, Paolo Romano @ IST.