{
  "slug": "ddsketch",
  "term": "DDSketch",
  "aliases": [
    "Distributed Distribution Sketch"
  ],
  "definition": "DDSketch is a mergeable quantile sketch that uses indexed value bins to control relative-value error, subject to its mapping and storage limits.",
  "note": "The original positive-value construction uses fixed logarithmic bins. Its unbounded form supports insertion, deletion and merging; bounded variants collapse bins and can lose the stated accuracy for affected quantiles. Uncollapsed bins still approximate values. [ddsketch-paper]\n\nThe reviewed Java implementation requires equal index mappings when merging and adds observation counts. Its weighted accept method rejects negative counts; the paper's deletion capability is not permission to pass negative weights to this API. Its quantile selection uses q*(n-1), not the nearest-rank ceil(q*n) convention. [ddsketch-java]\n\nMemory and accuracy depend on the store. An unbounded dense store grows with the covered value range; capped stores collapse extreme indexes when necessary. Keep the mapping, store policy and representable range with serialized data. [ddsketch-stores]\n\nA successful merge does not establish disjoint observation coverage or resolve a revised window. This is a provenance requirement inferred from additive counts, not an implementation defect.",
  "related": [
    "quantile-sketch",
    "quantile",
    "latency-histogram-bin"
  ],
  "citations": [
    {
      "id": "ddsketch-paper",
      "title": "Masson, Rim and Lee. DDSketch. PVLDB 12(12), 2195-2205, 2019; sections 1-2. DOI 10.14778/3352063.3352135.",
      "url": "https://www.vldb.org/pvldb/vol12/p2195-masson.pdf",
      "accessed": "2026-11-20"
    },
    {
      "id": "ddsketch-java",
      "title": "DataDog sketches-java, commit 0f403e84572be0c38e5a3e955986c4f436404204: DDSketch accept, mergeWith and getValueAtQuantile.",
      "url": "https://github.com/DataDog/sketches-java/blob/0f403e84572be0c38e5a3e955986c4f436404204/src/main/java/com/datadoghq/sketch/ddsketch/DDSketch.java",
      "accessed": "2026-11-20"
    },
    {
      "id": "ddsketch-stores",
      "title": "DataDog sketches-java, commit 0f403e84572be0c38e5a3e955986c4f436404204: DDSketches mapping and bounded/unbounded store contracts.",
      "url": "https://github.com/DataDog/sketches-java/blob/0f403e84572be0c38e5a3e955986c4f436404204/src/main/java/com/datadoghq/sketch/ddsketch/DDSketches.java",
      "accessed": "2026-11-20"
    }
  ],
  "status": "research",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-20",
  "provenance": [
    "Source review of the 2019 paper and Java implementation pinned to 0f403e84572be0c38e5a3e955986c4f436404204; no DDSketch execution or performance benchmark."
  ]
}
