bnclabs / gostore

Storage algorithms.
MIT License
35 stars 4 forks source link

BUBT: Use value log for reducing write amplification. #70

Closed prataprc closed 6 years ago

prataprc commented 6 years ago

After measuring with initial data load, with 200 byte payload, mem-level can ingest 30MB of data per second. But on the disk it translates to around 5x the ingestion rate. This may not be a big problem with fast SSDs and/or when mutations happen to a small subset of entries.

As a solution, to this problem we can save values in a separate file, bind value file to each zindex shard. We can make the bottoms up building to reuse the value file during compaction. We identify the following disadvantages to this approach.

a. When mutations are happening to a working set, might accumulate lots of garbage to the value file. b. Random read can incur atleast 2 IOPS in DGM cases.

for (a) we may have to do multiple levels of compaction, one across the file and another within the file. for (b) we may have to implement a nuanced mmap across mindex, zindex and value-file.