SillyDB it's a simple key-value store. To create it I'm being inspired from other key value stores like LevelDB, Redis, or Bitcask.
This is a personal project meant to learn about databases. To do so I'm trying to create my own one, following the book "Designing Data-Intensive Applications" as a guideline from Martin Kleppmann.
I'm also learning C so that's the reason behind the language choice. Maybe I'll make implementations for C++ and Rust in the future.
Using CMake
Build it from the terminal using the cmake
tool.
- Clone the project
git clone https://github.com/MarkelCA/SillyDB.git
cd SillyDB
- Create build folder
From the root folder:
mkdir build
cd build
cmake .. # Uses the CMakeLists.txt file from the parent folder
- Compile the project using the created build folder
cmake --build ./build
Compiling it from the CLion IDE has some advantages, one of them being the debugger capabilities that the IDE enables.
- Clone the repo
git clone https://github.com/MarkelCA/SillyDB.git
cd SillyDB
- Create the
cmake-build-debug
directory at the root folder.
From the root folder:
mkdir cmake-build-debug
- Run the CMakeLists.txt file from the IDE using the
Debug CMake
button.
- Start the server
./bin/start
- Connect to the database
telnet localhost 8080
This is a telnet prompt example with a bunch commands.
➜ ~ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
get foo
"bar"
get 1234
(nil)
set fizz buzz
"OK"
get fizz
"buzz"
set fizz bazz
"OK"
get fizz
"bazz"
get ae808cbc-f7e5-4a52-8187-aa8f5492308d
(nil)
set ae808cbc-f7e5-4a52-8187-aa8f5492308d {"firstName":"John","lastName":"Doe"}
"OK"
get ae808cbc-f7e5-4a52-8187-aa8f5492308d
"{"firstName":"John","lastName":"Doe"}"
list
"foo
x
ae808cbc-f7e5-4a52-8187-aa8f5492308d
fizz
a
b
"