Cuckoo filter


A cuckoo filter is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set, like a Bloom filter does. False positive matches are possible, but false negatives are not – in other words, a query returns either "possibly in set" or "definitely not in set". A cuckoo filter can also delete existing items, which is
not supported by Bloom filters.
In addition, for applications that store many items and
target moderately low false positive rates, cuckoo filters can achieve
lower space overhead than space-optimized Bloom filters.
Cuckoo filters were first described in 2014.

Algorithm description

A cuckoo filter uses a -way set-associative hash table based on cuckoo hashing to store the fingerprints of all items.
Particularly, the two potential buckets in the table for a given item required
by cuckoo hashing are calculated by the following two hash functions
:
Applying the above two hash functions
to construct a cuckoo hash table enables item relocation based only on fingerprints
when retrieving the original item is impossible.
As a result, when inserting a new item that requires relocating an existing item,
the other possible location in the table
for this item kicked out from bucket is calculated by
Based on partial-key cuckoo hashing, the hash table can achieve both highly-utilization,
and compactness because only fingerprints are stored. Lookup and delete operations of a cuckoo filter are straightforward.
There are a maximum of two locations to check by and.
If found, the appropriate lookup or delete operation can be performed in time.
More theoretical analysis of cuckoo filters can be found in the literature.

Comparison to Bloom filters

A cuckoo filter is similar to a Bloom filter in that they both are very fast and compact,
and they may both return false positives as answers to set-membership queries: