A simple key-value database written in C++17, CMake and nlohmann/json.
It supports basic operations like put, get, and delete, and stores data in a JSON file.
- Supports multiple data types:
int,double,string. std::variantis used for storing different data types.- A classical CRUD interface with
add,get,update, anddeleteoperations. - It stores data in a JSON file for persistence.
- Displaying sorting and filtering of key-value pairs.
- Displaying statistics about the stored data.
- C++17 compatible compiler
- CMake 3.10 or higher
- Internet connection to download nlohmann/json library
-
Clone the repository
-
Create a build directory and navigate into it:
mkdir build cd build -
Run CMake to configure the project:
cmake ..
-
Build the project:
cmake --build .
./mini_kv_db add username "cpprian"
./mini_kv_db add age 25
./mini_kv_db add balance 1234.56
# Read a record
./mini_kv_db get username
# Update a record
./mini_kv_db update age 26
# Search for a record
./mini_kv_db search user
# Display all records
./mini_kv_db list
# Delete a record
./mini_kv_db delete balance
# Clear the database
./mini_kv_db clear
# Display statistics
./mini_kv_db statsYou can also run the database in interactive mode:
./mini_kv_db interactive
# Or simply
./mini_kv_db- Transaction support (ACID properties)
- Concurrency control
- Indexing for faster searches
- Backup and restore functionality
- Encryption for data security
- Network support for remote access (TCP/HTTP server)
- Unit tests and integration tests (Google Test)
- Docker support
- Benchmarking