{
  "slug": "key-value-separation",
  "term": "Key-value separation",
  "aliases": [
    "KV separation"
  ],
  "definition": "Key-value separation stores values outside the main key index and retains references in that index.",
  "note": "Separating values does not eliminate cleaning. [blobdb]\n\nIn WiscKey, the LSM-tree sorts keys and value references; values append to a separate log. Deleting a key leaves garbage in that log. Ignoring pointer size, index amplification 10 and 16 B keys give (10 x 16 + 1024) / (16 + 1024) = 1.14 for 1 KB values, or 2.8 for 64 B values. [wisckey]\n\nFigure 12 compares a 4 GB scan of a 100-GB database, using 16-B keys and 64-B values at its smallest size. WiscKey's reported throughput was about one twelfth of LevelDB's when randomly loaded, versus about 25% lower when sequentially loaded. These are historical measurements, not a general separation penalty. [wisckey]\n\nWiscKey's collector reads the tail, checks liveness in the tree, copies live values to the head, then frees space; log records include keys. [wisckey]\n\nHashKV's Figure 2 reports vLog prototype write amplification of 19.7 for updates and 1.6 for loading. It loaded 40 GiB of 1-KiB pairs, then issued 40 GiB of Zipf(0.99) updates with 12 GiB of reserved space; its write cache was disabled. The ratio is total device-write bytes divided by inserted or updated bytes. This differs from section 4.1's 64 MiB cache defaults. HashKV's hash grouping avoids per-record tree lookups during cleaning. [hashkv]\n\nRocksDB's integrated BlobDB background-extraction path creates immutable, key-sorted blob files; separation therefore does not imply unsorted values. Values at or above min_blob_size qualify for blob files; smaller ones stay inline. Compaction relocates blobs and updates references without separate index operations. It supports WAL recovery and differs from legacy StackableDB. [blobdb] With an age cutoff of 0.25, blobs in the oldest 5 of 20 blob files are relocated when compaction reaches them. [blobdb] [rocksdbopts]",
  "status": "shipping",
  "advantages": [
    {
      "text": "In WiscKey, keeping keys and value references in the sorted index reduces its size relative to also storing values there.",
      "citationIds": [
        "wisckey"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Unreferenced values occupy space until garbage collection runs. The RUM paper frames read, update and space tradeoffs as a conjecture, not a universal proof that every engineering improvement must worsen another cost.",
      "citationIds": [
        "wisckey",
        "blobdb",
        "rum-paper"
      ]
    },
    {
      "text": "In WiscKey's collector, relocated records and the updated tail must be durable before old space is reclaimed. This is a reclamation protocol, not a universal synchronous-write requirement for every separated store.",
      "citationIds": [
        "wisckey"
      ]
    },
    {
      "text": "HashKV's segment-group scan also checks the write cache and still updates index addresses after moving survivors. Its hot/cold extension leaves tagged metadata in the group; the separate cold-data log uses vLog-style cleaning. The group's no-lookup rule does not describe every collector in the system.",
      "citationIds": [
        "hashkv"
      ]
    },
    {
      "text": "RocksDB v11.8.1 also has experimental Blob Direct Write v1, disabled by default. Qualifying Put values become BlobIndex references before WAL/memtable insertion. WAL replay of active direct-write files is unsupported; flush/SST creation must first make them manifest-visible. This differs from background extraction.",
      "citationIds": [
        "blob-direct-options"
      ]
    }
  ],
  "related": [
    "parallax",
    "lsm-tree",
    "value-log",
    "database-write-amplification",
    "hybrid-log",
    "fawn-ds",
    "tucana",
    "kreon",
    "bourbon",
    "kvell",
    "wisckey",
    "hashkv",
    "blobdb"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "blobdb",
      "title": "RocksDB wiki: BlobDB, integrated implementation, garbage collection and configuration (page revised 22 September 2022).",
      "url": "https://github.com/facebook/rocksdb/wiki/BlobDB",
      "accessed": "2026-11-03"
    },
    {
      "id": "hesela-kv",
      "title": "Key-value separation: the cleaning bill moves elsewhere",
      "url": "https://hesela.com/analyses/key-value-separation-cleaning-cost/",
      "accessed": "2026-10-12"
    },
    {
      "id": "wisckey",
      "title": "Lu et al. WiscKey: Separating Keys from Values in SSD-conscious Storage. FAST 2016, sections 3.3-3.5 and 4.1.2, Figure 12.",
      "url": "https://files.usenix.org/s3fs-public/cdn/fast16-papers-lu.pdf",
      "accessed": "2026-11-11"
    },
    {
      "id": "hashkv",
      "title": "Chan, Li, Lee and Xu. HashKV: Enabling Efficient Updates in KV Storage via Hashing. USENIX ATC 2018, section 2.2 and Figure 2; sections 3.2-3.4 and 4.1.",
      "url": "https://files.usenix.org/s3fs-public/cdn/atc18-chan.pdf",
      "accessed": "2026-11-11"
    },
    {
      "id": "rocksdbopts",
      "title": "RocksDB include/rocksdb/advanced_options.h, release v9.11.2, blob options.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.11.2/include/rocksdb/advanced_options.h",
      "accessed": "2026-10-16"
    },
    {
      "id": "rum-paper",
      "title": "Athanassoulis et al. Designing Access Methods: The RUM Conjecture. EDBT 2016, pp. 461-466, sections 1-4. DOI: 10.5441/002/edbt.2016.42.",
      "url": "https://openproceedings.org/2016/conf/edbt/paper-12.pdf",
      "accessed": "2026-11-22"
    },
    {
      "id": "blob-direct-options",
      "title": "RocksDB v11.8.1: advanced_options.h, experimental direct-write v1 contract.",
      "url": "https://github.com/facebook/rocksdb/blob/abeebd9630f11bd08c28b7bd43c7bdfc62050654/include/rocksdb/advanced_options.h#L1202-L1257",
      "accessed": "2026-12-02"
    }
  ],
  "updated": "2026-12-02",
  "provenance": [
    "Implementation details come from the RocksDB wiki and source, maintained by Meta, so they are not independent of the code owner.",
    "The 1.14 and 2.8 figures are formula results with the pointer size ignored, not measurements; the same formula gives 1.5 for 256 B values and 1.04 for 4 KB values.",
    "The unseparated write amplification of 3.1 and 14 (1 GB and 100 GB databases) and the 10% and 35% garbage-collection throughput drops are from the 2016 paper's own tests.",
    "The 19.7 figure is one workload on one university prototype; the paper reports 19.1 and 7.9 for two unseparated stores with default settings.",
    "Defaults are from release v9.11.2 and later versions change them; 0.25 x 20 = 5 files.",
    "2026-10-30 source-scope correction: separate prototype-specific statements from the integrated implementation; preserve the existing numerical examples and their prior limitations.",
    "Figure 12's axis specifies 16-B keys and varying values; the surrounding prose calls the smallest case 64-B pairs. We follow the axis and section 4.1's fixed-key method.",
    "Figure 12 used a 500-GB Samsung 840 EVO, Linux 3.14/ext4, 64 GB memory and disabled compression. No current-device prediction or independent reproduction is implied. [wisckey]"
  ]
}
