fluxen: a single-header key-value store for C++20
I built fluxen to solve a problem I kept running into in my side projects. I wanted persistent key-value storage without pulling in a full database or dealing with CMake/linking.
To use fluxen, you just drop the header into your project and you have a persistent key-value database that you can learn to use in an afternoon, with no CMake, no dependencies, and no linking.
#include "fluxen.hpp"
fluxen::DB db("myapp.db");
db.put("username", "jim");
if (auto name = db.get("username")) {
std::cout << *name << "\n"; // jim
}
It supports strings, numbers, and any trivially copyable type without the need for manual serialization. Transactions batch writes into a single syscall and guarantee durability via fsync.
GitHub: [https://github.com/dvuvud/fluxen](https://github.com/dvuvud/fluxen)
Docs: [https://dvuvud.github.io/fluxen](https://dvuvud.github.io/fluxen)
https://redd.it/1t928n5
@r_cpp
Post #25163
13