Replacement Policies: LRU, LFU and Segmented LRU

video locked
Enroll to watch

11 mins

Replacement Policies

In this video, we learn to determine which key needs to be evicted. This  is based on the replacement policy

LRU Policy (Least Recently Used)

In this policy, we evict the entry that has not been used for the longest. To implement this policy, we need to add another data point i.e., Last Used. 

To understand this policy, watch the video where you can understand it with examples. 

Time interval in which Write-Around Policy Replacement Policies LRU Policy (Least Recently Used) an entry was not used = current_timestamp - LastUsed for that entry. 

LFU Policy (Least Frequently Used)

In this policy, we evict the entry that is used least frequently.

Don't forget to watch the video for a better explanation using examples!!