An open API service indexing awesome lists of open source software.

https://github.com/migpovrap/keyvaluestore

Key Value Store developed for our Operating Systems class.
https://github.com/migpovrap/keyvaluestore

c multithreading operating-systems posix

Last synced: 4 months ago
JSON representation

Key Value Store developed for our Operating Systems class.

Awesome Lists containing this project

README

          

# KVS

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.

## Structure of the Project

### Part 1: KeyValueStore system

1. **WRITE:** Write one or more key-value pairs to the store.
2. **READ:** Read the values of one or more keys from the store.
3. **DELETE:** Delete one or more key-value pairs from the store.
4. **SHOW:** Display all key-value pairs in the store.
5. **WAIT:** Introduce a delay in the execution of commands.
6. **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]


### Part 2: Client-Server Communication

1. **DELAY:** Introduce a delay in the execution of commands.
2. **SUBSCRIBE:** Subscribe to specific keys to receive notifications.
3. **UNSUBSCRIBE:** Unsubscribe from specific keys.
4. **DISCONNECT:** Disconnect the client from the server.

Example Commands:


DELAY 1000
SUBSCRIBE [a]
UNSUBSCRIBE [a]
DISCONNECT

## Building and Usage of the project

#### Building
To build the project, use the provided Makefile (in the src directory):

```shell
make
```

#### Running the Server
To run the server, use the following command (in the src/server directory):

```shell
./server/kvs
```

- ``: Directory containing the job files.
- ``: Maximum number of threads to process job files.
- ``: Maximum number of concurrent backups.
- ``: Path to the server registration FIFO.

#### Running Clients
To run a client, use the following command (in the src/client directory):

```shell
./client/client
```

- ``: Unique identifier for the client.
- ``: Path to the server registration FIFO.

> [!NOTE]\
> When running multiple clients use different client id's.

## Credits
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.