Barebones model of Spotify's 'Recently Played' screen using a Least Recently Used (LRU) cache in Golang

One of the most used caching schemes is Least Recently Used (LRU). Caches that use this eviction strategy will remove the least recently used item when their size reaches their capacity. That means that such caches have to keep a track of the order of access of the cached items, so it would evict the correct items. Before we go too much into details about the implementation of an LRU cache, let’s first see what are the possible applications of this caching scheme....

March 11, 2019 · 13 min · Ilija

When and Why to use a Least Frequently Used (LFU) cache with an implementation in Golang

Over the years, people involved in computer science and engineering have worked really hard on optimisations of various natures. Given that we live in a world with limited resources, humanity has always worked on ways to optimise the costs and speed literally everything. In software engineering, I would argue, the most popular approach to performance improvement is caching. While there are various applications of caching, depending on the area of software engineering, the idea behind caching is quite simple: store data that is often needed/used in fast structure/storage so it can be retrieved very fast....

February 27, 2019 · 17 min · Ilija