GTStore is a distributed key-value store system that provides scalability, availability, and resilience to temporary node failures. It uses gRPC for network communication and supports replication for fault tolerance.
You can set up the GTStore development environment either manually or using Docker.
- CMake
- C++17 compatible compiler
- gRPC
- Protobuf
To set up GTStore using Docker, follow these steps:
docker build -t gtstore-dev .This will:
- Build the development environment with all dependencies
- Mount your project directory to
/appin the container
# In a separate terminal
docker run -it \
--name gtstore \
-v "$(pwd)":/app \
-v build_cache:/app/build \
-w /app \
gtstore-dev \
bashTo build the project, run:
./build.shThis will create a build directory and compile all the necessary components:
manager: Manager servicestorage: Storage node serviceclient: Client application
- Start the service with N storage nodes and R replicas:
./start_service.sh <num_nodes> <num_replicas>Example: ./start_service.sh 3 2 starts the system with 3 storage nodes and 2 replicas
- Use the client application:
# Put a key-value pair
./build/client --put <key> --val <value> [--id <client_id>] [--verbose]
# Get a value
./build/client --get <key> [--id <client_id>] [--verbose]Examples:
# Put a key-value pair
./build/client --put key1 --val value1 --verbose
# Get a value
./build/client --get key1 --verbose- Clean up all processes:
./clean.shThe project includes several test scripts in the tests directory:
- Single Server Test:
./tests/single_server_test.shTests basic operations on a single server setup.
- Multi-Server Test:
./tests/multi_server_test.shTests operations with multiple storage nodes.
- Single Node Failure Test:
./tests/single_node_failure_test.shTests system behavior when one storage node fails.
- Multi Node Failure Test:
./tests/multi_node_failure_test.shTests system behavior when multiple storage nodes fail.
- Run All Tests:
./tests/run_all_tests.shRuns all test scenarios in sequence.
Usage: client [options]
Options:
--put <key> Put a key
--val <value> Value for put operation (required with --put)
--get <key> Get a key
--id <client_id> Client ID (default: 1)
--verbose Enable verbose output
--help Show this help message
The project includes a benchmarks to evaluate system performance:
Use the following command to run all benchmarks:
./tests/benchmark_test.shGenerates the following plots:
- single_client_throughput.png
- concurrent_throughput.png
- loadbalance.png
- Single Client Throughput Test:
./build/benchmark --throughput <replicas>Tests the performance of a single client with a specified number of replicas.
- Concurrent Throughput Test:
./build/benchmark --concurrent <replicas> <threads>Tests the performance of multiple clients with a specified number of replicas and threads. Defaults to 8 threads.
- Load Balance Test:
./build/benchmark --loadbalanceTests the distribution of keys across nodes after a large number of insertions.
You will need to start the service before running the individual benchmarks.