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.
- Host: GitHub
- URL: https://github.com/migpovrap/keyvaluestore
- Owner: migpovrap
- License: mit
- Created: 2024-11-14T15:55:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-25T19:07:19.000Z (over 1 year ago)
- Last Synced: 2025-02-10T21:42:04.207Z (over 1 year ago)
- Topics: c, multithreading, operating-systems, posix
- Language: C
- Homepage:
- Size: 956 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.