FIFO, LRU, LFU three algorithms

Source: Internet
Author: User


When it comes to caching, there are two points that must be considered:
(1) The consistency of the cached data and the target data.
(2) Expiration policy (mechanism) of the cache.
Among them, the expiration policy of the cache involves the elimination algorithm. There are several common algorithms for elimination:
(1) Fifo:firstin first Out, FIFO
(2) lru:leastrecently used, least recently used
(3) lfu:leastfrequently used, most infrequently used
Note the difference between LRU and LFU. The LFU algorithm selects the least-used data item based on the number of times the data item is used, which is determined by the difference in usage times. LRU is determined by the difference in usage time.
A good caching framework must implement all of the above caching mechanisms.

FIFO, LRU, LFU three algorithms

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.