Roaring Bitmaps are a compressed data structure for representing sets of integers efficiently, widely used in vector databases to handle metadata filtering at speed. They store which records match a condition as a highly compressed bitmap that supports very fast set operations.
The structure is clever about compression: it divides the range of possible values into chunks and chooses the most efficient representation for each chunk depending on how dense or sparse it is, staying compact whether a set is small and scattered or large and dense. Crucially, operations like intersection and union between two Roaring Bitmaps are extremely fast, processing many values at once.
This makes them ideal for combining metadata filters during search. To find vectors matching several conditions, the database represents each condition’s matching set as a Roaring Bitmap and intersects them in a fraction of the time a record-by-record check would take. Roaring Bitmaps are a key reason some vector databases handle complex, high-cardinality filters with little performance penalty, underpinning fast bitmap filtering and efficient filtered and hybrid search.