Bitcoin more fire and fewer books and materials
The concept of cache buffer will not talk about
Filter determine whether this element is absent through the filter element in this judgment is not if not, then certainly not in
Whereas if it (with error) in the memory and taken from the database
chache and filter have some echoes
We are speaking about the hash function
Role is to get the value by mapping
There is a problem even if the hash value conflict? How to solve the map to the same value such as a list of key save it as a zipper
filter and cache are mutually complementary roles
filter and hash as above but the
A scattering element to which binary vector
Filter implementation Titus
Mapped to the long, long binary vector is a binary vector such as int 64
And can retrieve a Bloom filter element is in a set
Bloom filter advantages and disadvantages
Space complexity complexity of the event is far less than other algorithms
The disadvantage is not to lose the recognition rate and remove difficulties
Why so fast
Because it is a binary so fast but could not avoid a new problem is the low accuracy (the world is not a complete piece of cake Otherwise, why not just use him?)
So why do not identify low?
First, do not talk about his recognition rate
First of all elements of the time will not have time to do the recognition rate is certainly not the
If under any conditions recognition rates are only 80% of such cases so sure this algorithm is useless
Bloom filter implementation principle
For any element to mapping using a mapping function in the vector is set to 1 0
W for a new query case if the mapping w 0 then this certainly does not exist
Vernacular: A and E through on the left to the right Miaohong vector has three elements need to find ACB
Have found a b c not b there actually is not so. This has led not to lose another
Do not miss how to solve
The main job is to help filter element filter what does not exist and the cache so that a layer of the same block database to find if there is no go
So also with the back layer of the data management system, such as the latter is mysql data authority and the filters are pre-treated and cache module