{
  "slug": "ribbon-filter",
  "term": "Ribbon filter",
  "aliases": [
    "Ribbon approximate-membership filter"
  ],
  "definition": "A Ribbon filter is a static approximate-membership filter built from localized binary linear equations, trading construction work for compact storage.",
  "note": "The constructed filter is not a mutable set or a data-integrity checksum. Standard, homogeneous and bumped variants differ. RocksDB's bloom_equivalent_bits_per_key targets Bloom-equivalent filtering, not the actual bit count. [ribbon-paper] [ribbon-api]\n\nIn v9.7.3, selecting a Ribbon builder does not guarantee Ribbon output: construction can fall back to Bloom for a smaller representation, a failed banding-memory reservation or exhausted seed search. [ribbon-implementation]\n\nConstruction-memory charging uses an available block cache only when enabled; its compatibility default is disabled. This is separate from caching finished filters and is not a process-RSS cap. Compare actual output format, resident size and concurrent construction. [ribbon-accounting]\n\nHomogeneous Ribbon solves AZ=0 with randomized free variables instead of storing arbitrary assigned values. Its false-positive probability is p+(1-p)2^-r, where p is the probability that an absent key's coefficient vector lies in the stored rows' span. It is not exactly 2^-r in general. Localized row coefficients also do not make the sorted matrix a conventional fixed-diagonal band matrix. [ribbon-paper]",
  "related": [
    "bloom-filter",
    "sstable",
    "partitioned-filter",
    "xor-filter",
    "binary-fuse-filter",
    "retrieval-data-structure"
  ],
  "citations": [
    {
      "id": "ribbon-paper",
      "title": "Dillinger et al. Fast Succinct Retrieval and Approximate Membership using Ribbon. arXiv:2109.01892v2, sections 1-3 and 9.",
      "url": "https://arxiv.org/abs/2109.01892v2",
      "accessed": "2026-11-10"
    },
    {
      "id": "ribbon-api",
      "title": "RocksDB v9.7.3. include/rocksdb/filter_policy.h: NewRibbonFilterPolicy and bloom_before_level.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/include/rocksdb/filter_policy.h",
      "accessed": "2026-10-13"
    },
    {
      "id": "ribbon-implementation",
      "title": "RocksDB v9.7.3: Ribbon builder selection and construction fallbacks.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/table/block_based/filter_policy.cc",
      "accessed": "2026-10-17"
    },
    {
      "id": "ribbon-accounting",
      "title": "RocksDB v9.7.3: filter-construction cache charging and its default.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/include/rocksdb/table.h",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-ribbon",
      "title": "Hesela: Ribbon construction and cache-accounting boundaries.",
      "url": "https://hesela.com/analyses/bloom-filters-lsm-read-cost/#ribbon-fallback",
      "accessed": "2026-10-17"
    },
    {
      "id": "ribbon-review",
      "title": "Hesela: six version-pinned Ribbon selection and fallback cases.",
      "url": "https://hesela.dev/research/ribbon-policy-review.json",
      "accessed": "2026-10-17"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-10",
  "provenance": [
    "The v9.7.3 fallback conditions were checked in source code, not triggered in a runtime experiment; no fallback-frequency estimate is implied. [ribbon-implementation]"
  ]
}
