“This is the fourth day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

The bitmap

  • Application placement maps are also available in many middleware applications
    • It’s not a novel data structure, just internallybooltype-implemented
    • The main target tag 📌 is when large amounts of data are stored, such as when records are available online or offline1 and 2On behalf of
    • When the amount of accumulated data increases over time, we can use bits to represent itbit

Bloom filter

  • For bitmap applications, Bloom filter is the most incisive
    • Bloom filters are used in a wide range of scenarios. The principle is to determine if a value does not exist, it must not exist, and if it does exist, it may exist

    • Inside the Bloom filter, multiple hash() functions are used to map into arrays

    • As with HashMap, multiple hash functions are called each time a putKey is executed to evaluate an index value and modulo it into an array of bits

    • When you want to see if the key exists in the Bloom filter, multiple hash functions are called, and the key may exist if it is mapped to position 1

    • If there is a bit array of 0 in a position mapped to then the key does not exist in the Bloom filter

application

  • When we do statistics, if the data is very large
    • Using other types is obviously very memory intensive, so we can use bitmaps to save
    • For example, we often go to prevent user crawlers, willipWill save whitelist and blacklist, we can blacklist in bitmap
    • Bloom filterStore only blacklistsip
    • Reverse useBloom filterThe thought, if judged every timeipIs it black or white, if thisipIt’s not in the Bloom filter so it must be whitelisted
    • becauseBloom filterYou can definitely map to theta0Must not exist, so similar scenarios can be usedBloom filter