Skip to main content
QUICK REVIEW

[Paper Review] Buffered Count-Min Sketch on SSD: Theory and Experiments

Mayank Goswami, Dzejla Medjedovic|arXiv (Cornell University)|Apr 27, 2018
Advanced Data Storage TechnologiesComputer Science13 references3 citations
TL;DR

This paper proposes the Buffered Count-Min Sketch (BCMS), an SSD-optimized variant of the count-min sketch that uses hash localization to reduce random I/Os by grouping all hash operations for a single element onto a single SSD page. The method achieves 3.7×–4.7× faster insertions and 4.3× faster lookups on SSD while preserving the original count-min sketch’s error guarantees, reducing I/O complexity from O(r) to 1 per operation in the worst case.

ABSTRACT

Frequency estimation data structures such as the count-min sketch (CMS) have found numerous applications in databases, networking, computational biology and other domains. Many applications that use the count-min sketch process massive and rapidly evolving datasets. For data-intensive applications that aim to keep the overestimate error low, the count-min sketch may become too large to store in available RAM and may have to migrate to external storage (e.g., SSD.) Due to the random-read/write nature of hash operations of the count-min sketch, simply placing it on SSD stifles the performance of time-critical applications, requiring about 4-6 random reads/writes to SSD per estimate (lookup) and update (insert) operation. In this paper, we expand on the preliminary idea of the Buffered Count-Min Sketch (BCMS) [15], an SSD variant of the count-min sketch, that used hash localization to scale efficiently out of RAM while keeping the total error bounded. We describe the design and implementation of the buffered count-min sketch, and empirically show that our implementation achieves 3.7x-4.7x the speedup on update (insert) and 4.3x speedup on estimate (lookup) operations. Our design also offers an asymptotic improvement in the external-memory model [1] over the original data structure: r random I/Os are reduced to 1 I/O for the estimate operation. For a data structure that uses k blocks on SSD, was the word/counter size, r as the number of rows, M as the number of bits in the main memory, our data structure uses kwr/M amortized I/Os for updates, or, if kwr/M >1, 1 I/O in the worst case. In typical scenarios, kwr/M is much smaller than 1. This is in contrast to O(r) I/Os incurred for each update in the original data structure.

Motivation & Objective

  • To address the performance bottleneck of count-min sketch when scaled beyond main memory by moving to SSD, where random I/Os severely degrade performance.
  • To design a variant of the count-min sketch that minimizes external memory I/Os for both update and query operations on SSD.
  • To maintain the original count-min sketch’s probabilistic error guarantees (Pr[Error ≥ nε(1+o(1))] ≤ δ+o(1)) despite hash localization.
  • To empirically validate that hash localization does not degrade overestimate quality in practice.
  • To provide theoretical and practical evidence that BCMS achieves optimal I/O complexity for lookup and near-optimal amortized I/O for updates.

Proposed method

  • The Buffered Count-Min Sketch (BCMS) organizes the sketch into fixed-size pages on SSD, with all hash functions for a given item mapped to the same page via a page-level hash function.
  • Each update or query operation accesses only one SSD page, reducing random I/Os from O(r) to 1 in the worst case.
  • The data structure uses a buffer to group updates and minimize I/Os, with amortized I/O cost of kwr/M per update, where k is number of blocks, w is word size, r is number of rows, and M is main memory size.
  • Theoretical analysis proves that the error probability remains bounded as in the original CMS: Pr[Error(q) ≥ nε(1+o(1))] ≤ δ + o(1).
  • The sketch is configured using parameters δ (failure probability), ε (error tolerance), and sketch size, with depth r = ⌈ln(1/δ)⌉ and width ⌈e/ε⌉.
  • Empirical evaluation uses a 1TB SSD with 32GB RAM, measuring insert and query throughput across varying sketch sizes and RAM-to-sketch ratios.

Experimental results

Research questions

  • RQ1Can hash localization in a count-min sketch variant reduce SSD I/Os from O(r) to 1 per operation while preserving error guarantees?
  • RQ2Does the performance gain from reduced I/Os translate to measurable speedups in real SSD workloads?
  • RQ3To what extent does hash localization affect the overestimate error in practice?
  • RQ4Is the amortized I/O cost for updates in BCMS significantly lower than O(r) in the external-memory model?
  • RQ5Can BCMS maintain the same error probability and overestimate bounds as the original count-min sketch under real-world workloads?

Key findings

  • The buffered count-min sketch achieves 3.7×–4.7× higher insert throughput compared to the original count-min sketch on SSD, with the speedup increasing as sketch size grows beyond RAM.
  • The query throughput of BCMS is 4.3× faster than the original count-min sketch, due to single I/O per query instead of up to r I/Os.
  • The average and maximum overestimate values are identical between the original count-min sketch and BCMS across all tested sketch sizes, confirming no degradation in error quality.
  • The theoretical I/O complexity for lookup is reduced from O(r) to 1 in the worst case, and for updates to kwr/M amortized I/Os, which is often sub-1 in practice.
  • Empirical results confirm that hash localization does not substantially degrade the error rate, as the overestimate remains within the theoretical bounds of the original CMS.
  • The BCMS design achieves optimal I/O behavior for lookups and near-optimal amortized I/O for updates, suggesting strong practical efficiency on SSD.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.