Cache breakdown, cache penetration, cache avalanche

[Mandatory] Do not allow any magic value (that is, undefined constant) to appear directly in the code.

  反例:String key = "Id#taobao_" + tradeId;         cache.put(key, value);      

// When caching get, there is a problem due to cache breakdown due to missing underscore when copying code

The process of background caching is roughly that, if the front end fetches data, if the cache is not available, it will take the database query

Cache penetration

   Cache penetration refers to data that is not in the cache and the database, and the user continuously initiates requests

Cache breakdown

  Cache breakdown refers to the data that is not in the cache but exists in the database (usually the cache time expires). At this time, because there are particularly many concurrent users, the data is not read by the read cache at the same time, and the data is fetched from the database at the same time, causing database pressure. Instant increase, causing excessive pressure

Cache breakdown

  Cache avalanche refers to the large amount of data in the cache to the expiration time, and the huge amount of query data, causing excessive database pressure and even downtime. Different from cache breakdown, cache breakdown refers to checking the same piece of data concurrently. Cache avalanche means that different data has expired, and many data cannot be found to check the database.

Guess you like

Origin www.cnblogs.com/xyzxy/p/12674939.html