{
  "schemaVersion": 1,
  "title": "Ribbon versus Bloom: synthetic filter-memory snapshots",
  "evidenceType": "deterministic worked example, not measured process memory",
  "generatedAt": "2026-10-13T12:23:21.472Z",
  "humanPage": "https://hesela.com/analyses/bloom-filters-lsm-read-cost/#ribbon",
  "codePath": "/research/filter-memory.mjs",
  "license": "CC0 applies to Hesela code and invented examples only; source works retain their rights.",
  "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/",
  "sourceUrl": "https://rocksdb.org/blog/2021/12/29/ribbon-filter.html",
  "sourceAccessed": "2026-10-13",
  "method": "Additional bytes = ((230 - 75) * buildingKeys - (10 - 7) * residentKeys) / 8.",
  "units": {
    "residentKeys": "entries",
    "buildingKeys": "entries",
    "builders": "concurrent builders",
    "residentSavedBytes": "bytes",
    "additionalBuildBytes": "bytes",
    "netAdditionalBytes": "bytes"
  },
  "assumptions": {
    "bloomResidentBitsPerKey": 10,
    "ribbonResidentBitsPerKey": 7,
    "bloomBuildBitsPerKey": 75,
    "ribbonBuildBitsPerKey": 230
  },
  "limits": [
    "Rounded historical implementation estimates; not constants of all Ribbon variants.",
    "Completed resident entries and currently built entries are disjoint populations.",
    "Each synthetic builder represents one million entries; resident population is 100 million.",
    "Identical residency assumed across policies; cache admission and eviction are not modeled.",
    "No data cache, indexes, memtables, allocator overhead, CPU cost or output-buffer timing.",
    "Negative netAdditionalBytes means lower memory only within this additive snapshot model."
  ],
  "examples": [
    {
      "builders": 1,
      "residentKeys": 100000000,
      "buildingKeys": 1000000,
      "residentSavedBytes": 37500000,
      "additionalBuildBytes": 19375000,
      "netAdditionalBytes": -18125000
    },
    {
      "builders": 2,
      "residentKeys": 100000000,
      "buildingKeys": 2000000,
      "residentSavedBytes": 37500000,
      "additionalBuildBytes": 38750000,
      "netAdditionalBytes": 1250000
    },
    {
      "builders": 4,
      "residentKeys": 100000000,
      "buildingKeys": 4000000,
      "residentSavedBytes": 37500000,
      "additionalBuildBytes": 77500000,
      "netAdditionalBytes": 40000000
    },
    {
      "builders": 8,
      "residentKeys": 100000000,
      "buildingKeys": 8000000,
      "residentSavedBytes": 37500000,
      "additionalBuildBytes": 155000000,
      "netAdditionalBytes": 117500000
    }
  ]
}
