Hacker News new | ask | show | jobs
by alexnewman 4058 days ago
Congrats, how does compaction work? I assume you can serve kvs from memory?
2 comments

Compaction in LogCabin uses a snapshotting approach. It writes a header to a snapshot file, then forks off a child process to write the data into a snapshot. The data is just each node in the tree serialized as a protobuf using a pre-order traversal, IIRC. Much more detail on compaction [1] mentioning LogCabin explicitly.

LogCabin does currently keep all data in memory, so it never touches disk for read requests. It also keeps a copy of the entire log in memory for now, but I hope to address that eventually [2].

[1] https://github.com/ongardie/dissertation#readme

[2] https://github.com/logcabin/logcabin/issues/106

Oh and can I call this from c easily?
There's not currently an extern "C" wrapper, but I don't think that'd be too much work to write.
Oh and can I stop using zk now?