A quack quacky UDP cache server 🦆, developed for the Networking course of "Sicurezza dei Sistemi e Delle Reti Informatiche" bachelor's degree program.
Ducky is an network cache server written in C.
It stores unstructured data sent from a client in memory, ready to be served when a client asks for it using a unique key.
Ducky's principal purpose is to reduce networking and computation load from a server (for example, an API, a Web application, or a database) so that a client can store data that is accessed with a high frequency, increasing the overall performance of the system.
Ducky is loosely inspired by projects like Memcached and Redis.
While Ducky's approach to the "key-value" server implementation is naive, it worked well as a demonstrative and learning project on how to build a simple networking server.
Ducky's is documented here: protocol.
Ducky is a portable project and has only one dependency:
- greatest, used to write the unit tests for the project
Ducky is built with an out-of-source approach using CMake.
To build Ducky first clone the repository and then, inside the Ducky folder, generate the build tree:
$ cmake -B ./build
Now you can build the project:
$ cmake --build ./build
To run the unit tests just use the following command:
$ cmake --build ./build --target test
To start Ducky simply enter in the build/src
folder and run the executable:
$ cd build/src
$ ./ducky
14:00:57 INFO Ducky up and running, listening on port 20017
Now you can start to store and or retrieve data from Ducky; just open another terminal session and use Netcat to send commands via UDP:
$ nc -u localhost 20017
SET key data
201 CREATED
GET key
200 data
A huge thanks go to Roberto Carrà for his precious work on the logo.