This project implements a key-value store using SPDK and gRPC. It provides a simple API for storing, retrieving, and deleting key-value pairs.
The project uses a number of C++ libraries in addition to gRPC and Protobuf. Make sure the following packages are available on your system before building:
- CMake (version 3.10 or higher)
- C++17 compiler (gcc or clang)
- gRPC and Protocol Buffers
- Boost (container component)
- Folly
- fmt
- nlohmann_json
- gflags and glog
- libsnappy, liblz4 and libzstd
- libiberty (from binutils, required by folly)
- GTest (for running the unit tests)
- Git (for submodules)
Folly is not available in the standard Ubuntu repositories. Use the following steps to build and install it from source:
sudo apt-get install -y git cmake g++ libboost-all-dev \
libdouble-conversion-dev libgoogle-glog-dev libgflags-dev \
libevent-dev libssl-dev libfmt-dev libiberty-dev \
libsnappy-dev liblz4-dev libzstd-dev
git clone https://github.com/facebook/folly.git
cd folly
git submodule update --init --recursive
mkdir _build && cd _build
cmake ..
make -j$(nproc)
sudo make install
More details are available in Folly's installation guide.
-
Clone the repository:
git clone <repository-url> cd SpdkKeyValueStore
-
Install the required system packages (Ubuntu example):
sudo apt-get update sudo apt-get install -y cmake g++ libboost-container-dev \ libgrpc++-dev protobuf-compiler libprotobuf-dev \ libgoogle-glog-dev libgflags-dev nlohmann-json3-dev \ libfmt-dev libsnappy-dev liblz4-dev libzstd-dev libiberty-dev
If Folly is not available as a package, follow the steps in the Installing Folly on Ubuntu section.
-
Initialize and update submodules:
git submodule update --init --recursive
-
Create a build directory and navigate into it:
mkdir build cd build
-
Configure the project with CMake:
cmake ..
This step also generates the protobuf and gRPC source files in the
build/
directory. -
Build the project:
make
-
Run the server:
./server
The server listens on port
50051
by default. To use a different port, edit theaddress
field insrc/config/runtime_config.json
or pass a custom configuration file as the first argument when starting the server. -
In another terminal, run the client:
./client
proto/
: Contains the Protocol Buffers definition file (kvstore.proto
).src/
: Contains the C++ source files for the server and client.build/
: Contains the build artifacts. Protobuf and gRPC source files are generated here when CMake configures the project.third_party/
: Contains external dependencies (gRPC).
This project is licensed under the MIT License. See the LICENSE file for details.