4 ms·
> use a kv store for this, trust me Order is important here - is this inherent in your key?
by bch 8y ago
> use a kv store for this, trust me
Order is important here - is this inherent in your key?
- ccleve 8y agoYes. I did two implementations, one with plain text files and one with a kv store. For plain text files, I had to maintain file offsets of the records so I could traverse backward and truncate records that had to be replaced, and then break the files into segments so I could retire segments that are no longer needed. It had all kinds of little bugs. Then I reimplemented using a kv store, and it took a tiny fraction of the time. And surprisingly had better performance. Just create a good interface at the start, use the kv store underneath, and then later if you don't want the dependency swap it out for the more complicated code.