Introduction
Bloom filters are fundamental data structures in modern database systems, used to efficiently test set membership and avoid unnecessary disk I/O. However, as datasets grow, traditional Bloom filters face a "locality crisis." To maintain low false-positive rates, filters must be large, often exceeding available RAM. When moved to secondary storage, the random bit-level access patterns of traditional Bloom filters lead to severe performance degradation. Even within RAM, large filters suffer from frequent CPU cache misses. This paper proposes the Buffered Bloom Filter (BBF), an SSD-aware data structure designed to leverage high-capacity flash storage while maintaining high performance.
Methodology
The BBF addresses the locality bottleneck through a two-layer hierarchical architecture. The large bit vector is partitioned into "virtual pages" that align with the physical page size of the SSD.
Partitioning and Buffering
Instead of immediate SSD access, the BBF utilizes a small RAM buffer. Each sub-filter on the SSD is mapped to a dedicated buffer block in memory. Updates and queries are accumulated in these blocks. Once a buffer block is full, the system performs a single bulk I/O operation—reading the corresponding SSD page, applying all buffered operations, and writing the page back. This amortizes the cost of SSD access across many operations.
Starvation Avoidance
To ensure acceptable query latency, a timeout mechanism ($t_{max}$) is implemented. If a buffer block does not reach capacity within a specified timeframe, it is flushed regardless, preventing individual requests from being delayed indefinitely.
Evaluation
The authors evaluated the BBF using synthetic workloads of 50 to 100 million records, modeled after TPC-H schema join optimizations.
Performance and Efficiency
The BBF demonstrates significant performance gains over traditional approaches. On an SSD, the BBF operates approximately eight times faster than on a traditional Hard Disk Drive (HDD). Furthermore, because the BBF can utilize the vast capacity of SSDs, it can achieve false-positive rates an order of magnitude lower than RAM-constrained traditional filters.
As shown in the experimental results, the BBF exhibits a performance crossover. Once the allocated RAM buffer reaches a threshold (e.g., 32MB for a 256MB filter), the BBF begins to outperform traditional RAM-resident filters. This is because the BBF's grouped processing improves CPU cache locality, mitigating the cache-miss penalties that plague large, random-access bit vectors in memory.
Conclusion
The Buffered Bloom Filter successfully bridges the gap between high-speed RAM and high-capacity SSDs. By transforming random bit-level accesses into sequential page-level I/O, the BBF allows for massive, high-precision filters with a minimal memory footprint. While the approach introduces some complexity, such as out-of-order result processing, the performance and scalability benefits make it a compelling solution for large-scale database systems. Future work may extend this "partition-and-buffer" strategy to other memory-intensive structures like hash tables and search trees.
Summary updated