Skip to content

CountMinSketch

kavi castelo edited this page Nov 18, 2025 · 1 revision

Count–Min Sketch

CMS is a probabilistic frequency estimator used at scale (CDNs, databases, TinyLFU, Redis Streams).


🔍 Key Features

  • Sub-linear memory
  • Probabilistic (overestimates only)
  • Fast: O(1) updates and queries

📐 Diagram

graph TB
    subgraph CMS [Count-Min Sketch Matrix]
        direction TB
        R1[Hash 1 → buckets]
        R2[Hash 2 → buckets]
        R3[Hash 3 → buckets]
        R4[Hash 4 → buckets]
    end
Loading

👍 Strengths

  • Scalable to billions of keys
  • No need to store actual keys

Clone this wiki locally