You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/develop/data-types/probabilistic/bloom-filter.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ categories:
10
10
- kubernetes
11
11
- clients
12
12
description: Bloom filters are a probabilistic data structure that checks for presence
13
-
of an element in a set
13
+
of an item in a set
14
14
linkTitle: Bloom filter
15
15
stack: true
16
16
title: Bloom filter
17
17
weight: 10
18
18
---
19
19
20
-
A Bloom filter is a probabilistic data structure in Redis Stack that enables you to check if an element is present in a set using a very small memory space of a fixed size.
20
+
A Bloom filter is a probabilistic data structure in Redis Stack that enables you to check if an item is present in a set using a very small memory space of a fixed size.
21
21
22
-
Instead of storing all of the elements in the set, Bloom Filters store only the items' hashed representation, thus sacrificing some precision. The trade-off is that Bloom Filters are very space-efficient and fast.
22
+
Instead of storing all the items in a set, a Bloom Filter stores only the items' hashed representation, thus sacrificing some precision. The trade-off is that Bloom Filters are very space-efficient and fast.
23
23
24
-
A Bloom filter can guarantee the absence of an element from a set, but it can only give an estimation about its presence. So when it responds that an element is not present in a set (a negative answer), you can be sure that indeed is the case. But one out of every N positive answers will be wrong. Even though it looks unusual at a first glance, this kind of uncertainty still has its place in computer science. There are many cases out there where a negative answer will prevent more costly operations, for example checking if a username has been taken, if a credit card has been reported as stolen, if a user has already seen an ad and much more.
24
+
A Bloom filter can guarantee the absence of an item from a set, but it can only give an estimation about its presence. So when it responds that an item is not present in a set (a negative answer), you can be sure that indeed is the case. But one out of every N positive answers will be wrong. Even though it looks unusual at first glance, this kind of uncertainty still has its place in computer science. There are many cases out there where a negative answer will prevent more costly operations, for example checking if a username has been taken, if a credit card has been reported as stolen, if a user has already seen an ad and much more.
25
25
26
26
## Use cases
27
27
@@ -142,7 +142,7 @@ Just as a comparison, when using a Redis set for membership testing the memory n
142
142
memory_with_sets = capacity*(192b + value)
143
143
```
144
144
145
-
For a set of IP addresses, for example, we would have around 40 bytes (320 bits) per element - considerably higher than the 19.170 bits per item we need for a Bloom filter with a 0.01% false positives rate.
145
+
For a set of IP addresses, for example, we would have around 40 bytes (320 bits) per item - considerably higher than the 19.170 bits we need for a Bloom filter with a 0.01% false positives rate.
146
146
147
147
148
148
## Bloom vs. Cuckoo filters
@@ -155,7 +155,7 @@ Cuckoo filters are quicker on check operations and also allow deletions.
155
155
156
156
Insertion in a Bloom filter is O(K), where `k` is the number of hash functions.
157
157
158
-
Checking for an element is O(K) or O(K*n) for stacked filters, where n is the number of stacked filters.
158
+
Checking for an item is O(K) or O(K*n) for stacked filters, where n is the number of stacked filters.
0 commit comments