Tagged articles
LFU
55 articles · Page 1 of 1
This article explains why LRU needs a doubly linked list, how to achieve O(1) LFU with two hash maps and a minFreq pointer, and why Redis uses approximate LRU and an 8‑bit Morris counter for LFU, providing full Java, Go, and Python implementations.
Cache EvictionGoJava
0 likes · 5 min read

Adding a cache layer without proper design can cause data inconsistency, cache breakdown, and performance volatility; this article breaks down cache patterns, eviction strategies, concurrency controls, and distributed consistency models, showing when and how to apply each for reliable high‑performance systems.
CacheCache AsideConcurrency
0 likes · 14 min read

The article explains how Redis eviction policies work, why configuring maxmemory and a proper policy is essential to avoid OOM crashes, details each of the eight policies, shows practical configuration and monitoring commands, and dives into the source‑code implementation of LRU/LFU eviction.
CachingLFULRU
0 likes · 30 min read

Redis implements an approximate LRU using random sampling and timestamps, while classic LRU relies on exact access order; the article explains both LRU and LFU fundamentals, their Java implementations, Redis-specific variants, trade‑offs, use‑case recommendations, and configuration tips for selecting the optimal eviction policy.
Cache EvictionJavaLFU
0 likes · 21 min read

This article explains how Redis handles key expiration, the TTL and TTI concepts, periodic and lazy deletion strategies, their impact on persistence and replication, and the various memory eviction policies—including LRU and LFU—so developers can efficiently manage data and improve system performance.
LFULRUTTL
0 likes · 10 min read

The article analyzes a Meituan interview question about caching 10 million MySQL rows when Redis can store only 200 thousand rows, presenting a five‑step three‑tier cache architecture that separates cold and hot data, selects appropriate eviction policies, uses proactive hotspot detection, adds multi‑level defense, and employs both scheduled and real‑time pre‑heating, with performance numbers showing an 85% hit rate and 100 ms latency.
HotKeyLFULRU
0 likes · 29 min read

This article explains how Redis uses memory as a cache, details the maxmemory setting and its configuration methods, describes various eviction policies—including LRU, LFU, and random strategies—and outlines expiration handling, replication considerations, and best‑practice recommendations for stable high‑load deployments.
LFULRUeviction policy
0 likes · 10 min read

This article explains Redis's LRU and LFU eviction algorithms, their implementation details, code structures, and practical guidance on choosing the right policy based on workload characteristics.
LFULRUdatabases
0 likes · 6 min read

This article explains Redis's eight memory eviction policies, their ideal use cases, and provides step‑by‑step commands and configuration examples for querying and setting both the eviction strategy and maximum memory limits.
CacheDatabase ConfigurationLFU
0 likes · 6 min read

This article explains Redis 4.0's LFU‑based hot key detection mechanism, including its probabilistic counter algorithm, decay factor, and configuration options, and then describes Redis 6.0 client‑side caching with tracking, default and broadcast modes, and related protocol considerations.
Client CacheLFUhot key detection
0 likes · 12 min read

This article explains Redis 4.0's LFU‑based hot‑key detection mechanism, the probabilistic counter algorithm, its configuration options, and how Redis 6.0 introduces client‑side caching with tracking and broadcasting modes to keep client data consistent with the server.
Client Side CachingLFUdatabase optimization
0 likes · 13 min read

This guide explains Redis's eight memory eviction policies, their algorithms, ideal scenarios, and step‑by‑step configuration via redis.conf, CONFIG SET, or command‑line options, helping you choose the right strategy to balance performance, data safety, and resource limits.
CachingLFULRU
0 likes · 27 min read

This article explains how Redis handles memory exhaustion by configuring maxmemory and maxmemory-policy, detailing each eviction strategy (noeviction, volatile‑lru, volatile‑lfu, volatile‑ttl, volatile‑random, allkeys‑lru, allkeys‑lfu, allkeys‑random), their implementation details, and the underlying approximate LRU algorithm.
LFULRUdatabases
0 likes · 8 min read

When Redis memory reaches its configured maxmemory limit, it triggers a set of eviction policies—such as noeviction, allkeys‑lru, volatile‑lfu, and others—to decide which keys to discard, and this article explains how to view, configure, and understand each strategy.
LFULRUdatabase
0 likes · 9 min read


政采云技术Oct 25, 2023 · Databases
This article provides a comprehensive overview of Redis memory management, detailing how maxmemory limits trigger various eviction policies, explaining the internal freeMemoryIfNeeded algorithm, and describing expiration mechanisms—including active and lazy deletion—and offering guidance on selecting the appropriate eviction strategy for different workloads.
CacheLFULRU
0 likes · 18 min read

This article explains how Redis uses the maxmemory setting to trigger memory eviction, details the various eviction policies (including LRU and LFU), shows how to query and modify these settings with config commands, and briefly mentions promotional offers for a ChatGPT community.
LFULRUdatabases
0 likes · 10 min read

This article explains what Redis hot keys are, how they cause load imbalance in clustered environments, and presents multiple detection techniques and practical mitigation strategies such as rate limiting, second‑level caching, key sharding, and configuration‑center approaches.
BackendCacheHot Key
0 likes · 12 min read

This article explains Redis's LFU eviction algorithm, its implementation details, code-level mechanics, configuration steps, and how it improves upon LRU by using frequency-based counters and decay to make smarter cache eviction decisions.
AlgorithmCache EvictionLFU
0 likes · 12 min read

This article explains how Redis handles memory exhaustion by distinguishing expiration and eviction policies, detailing the maxmemory setting, enumerating all eviction strategies—including LRU and LFU algorithms—and showing how to view and modify these policies for optimal cache performance.
CacheLFULRU
0 likes · 9 min read

This article explains the principles, implementation details, and trade‑offs of Redis’s LRU and LFU cache eviction algorithms, including their data structures, code snippets, configuration parameters, and practical guidance on choosing the appropriate strategy based on workload characteristics.
Cache EvictionLFULRU
0 likes · 13 min read

Redis implements approximate LRU and LFU eviction policies by sampling keys and using a compact 24‑bit field to store timestamps and counters, where LRU evicts the least recently accessed items and LFU evicts those with low, decay‑adjusted access frequency, each with trade‑offs for different workloads.
AlgorithmCache EvictionLFU
0 likes · 13 min read

Redis uses key expiration commands, periodic scanning, and a combination of lazy and active deletion strategies, and when memory is full it applies one of eight eviction policies—including refined LRU and LFU algorithms with sampling and decay mechanisms—to decide which keys to discard.
Eviction PoliciesKey ExpirationLFU
0 likes · 13 min read

This article explains how to size Redis memory, configure maxmemory and maxmemory‑policy settings, and choose among various eviction strategies—including no‑eviction, allkeys‑lru, allkeys‑lfu, and volatile options—while detailing the underlying LRU and LFU algorithms used by Redis.
BackendLFUMemory
0 likes · 7 min read

This article explains how Redis handles key expiration, the three expiration deletion strategies, the eight memory‑eviction policies configurable via maxmemory, and the inner workings of Redis's LRU and LFU algorithms, including sampling, lru_clock, and counter decay mechanisms.
Eviction PoliciesLFULRU
0 likes · 13 min read

Redis caches can fill up, requiring memory eviction; this guide explains how to set Redis maxmemory (e.g., 5GB), choose appropriate eviction policies such as allkeys-lru or allkeys-lfu, and details the underlying LRU and LFU algorithms and their configuration commands.
LFULRUeviction policy
0 likes · 7 min read

This article explains how to set Redis memory limits, choose appropriate eviction policies such as noeviction, allkeys‑lru, allkeys‑lfu, volatile‑ttl, and describes the underlying LRU and LFU algorithms, including their implementation details and practical configuration commands.
LFULRUdatabases
0 likes · 9 min read

This article explains how to size Redis memory, configure maxmemory and maxmemory‑policy, and details the various eviction strategies—both non‑eviction and eviction policies—while describing the inner workings of Redis's LRU and LFU algorithms and their practical trade‑offs.
LFULRUeviction policy
0 likes · 7 min read

This article explains how Redis handles memory pressure using configurable maxmemory limits and a variety of eviction policies—including noeviction, volatile‑lru, volatile‑lfu, allkeys‑lru, and allkeys‑random—while offering guidance on selecting appropriate policies and sizing cache capacity for optimal performance.
Eviction PoliciesLFULRU
0 likes · 7 min read

This article explains Redis's in‑memory database architecture, detailing data locality, various eviction policies such as LRU, LFU, random and TTL, their configuration via maxmemory settings, and provides code examples of the eviction process and memory‑freeing functions.
LFULRUTTL
0 likes · 17 min read

This article explains the Least Frequently Used (LFU) cache eviction strategy, contrasts it with LRU, and provides a complete Java implementation—including node definition, insertion, sorting, removal, and retrieval logic—along with a test scenario and discussion of LFU's drawbacks.
AlgorithmCacheJava
0 likes · 13 min read

Redis handles key expiration using commands like EXPIRE, PEXPIRE, EXPIREAT, and PEXPIREAT, offers TTL queries, and employs three deletion strategies—timed, lazy, and periodic scanning—while its eight eviction policies (e.g., volatile‑lru, allkeys‑lfu, noeviction) and refined LRU/LFU algorithms manage memory pressure efficiently.
Eviction PoliciesLFULRU
0 likes · 14 min read

This article explains how Redis handles memory exhaustion by setting key expirations with commands like expire and pexpire, describes its lazy and periodic expiration strategies, details the eight configurable eviction policies, and dives into the internal LRU and LFU algorithms used for key eviction.
LFULRUdatabases
0 likes · 12 min read


ITPUBApr 15, 2021 · Databases
This article explains how to set Redis's maximum memory usage via configuration files or runtime commands, details all built‑in eviction policies, demonstrates retrieving and changing these policies, and dives into the LRU and LFU algorithms—including Java sample code and Redis's approximate LRU implementation.
LFULRUdatabases
0 likes · 11 min read

This article explains how Redis handles memory exhaustion by using key expiration commands, describes the three expiration strategies, details the eight maxmemory eviction policies, and dives into the internal LRU and LFU algorithms with their configuration parameters and code examples.
Eviction PoliciesLFULRU
0 likes · 14 min read

This article explains how to configure Redis's maximum memory, describes the various eviction policies—including noeviction, allkeys‑lru, volatile‑lru, random and ttl strategies—covers how to query and set these policies, and details the LRU and LFU algorithms used by Redis for cache management.
LFULRUMemory
0 likes · 9 min read

Learn how to set Redis's maximum memory usage, understand its various eviction policies—including noeviction, allkeys‑lru, volatile‑lru, allkeys‑random, volatile‑random, volatile‑ttl, and the newer LFU strategies—plus see Java code examples and insights into approximate LRU implementation.
Eviction PoliciesJavaLFU
0 likes · 13 min read

This article explains how Redis handles key expiration, the commands for setting TTL, the three expiration strategies, the eight eviction policies, and the internal LRU and LFU algorithms, including their implementation details, sampling techniques, and configuration parameters for memory management.
Eviction PoliciesLFULRU
0 likes · 13 min read

This article explains how Redis handles key expiration, the commands for setting TTL, the three expiration strategies, the eight memory‑eviction policies, and the internal LRU and LFU algorithms used to manage hot data when memory is exhausted.
LFULRUeviction
0 likes · 12 min read

This article explains how to set Redis's maximum memory usage, configure eviction policies such as noeviction, allkeys‑lru, volatile‑lru, allkeys‑random, and LFU, demonstrates command‑line and configuration‑file methods, and provides a Java implementation of an LRU cache.
JavaLFULRU
0 likes · 12 min read

This article explains how Redis handles memory exhaustion by setting key expirations, describes the four expiration commands, details the three expiration strategies, outlines the eight eviction policies, and dives into the inner workings of Redis's LRU and LFU algorithms with configuration examples.
LFULRUeviction
0 likes · 13 min read

This article explains how to configure Redis's maximum memory usage, describes the built‑in eviction strategies such as noeviction, allkeys‑lru, volatile‑lru, random and ttl policies, shows how to query and set these policies via configuration files or runtime commands, and details the LRU and LFU algorithms used by Redis, including Java sample code and recent improvements in Redis 3.0 and 4.0.
LFULRUeviction policy
0 likes · 9 min read

Redis, an in‑memory key‑value store, lets you set a maximum memory limit via configuration files or runtime commands, choose among various eviction strategies such as noeviction, allkeys‑lru, volatile‑lru, and LFU, and understand how approximate LRU works, with Java code examples illustrating these concepts.
LFULRUeviction policy
0 likes · 10 min read

This article explains how to configure Redis's maximum memory usage, modify memory limits at runtime, understand the built‑in eviction strategies—including noeviction, allkeys‑lru, volatile‑lru, allkeys‑random, volatile‑random, and volatile‑ttl—how to query and set these policies, and the details of LRU and LFU algorithms with Java examples and performance comparisons.
LFULRUeviction policy
0 likes · 10 min read

This article explains how Redis handles memory limits with the maxmemory setting, describes the six eviction policies—including noeviction, allkeys‑lru, volatile‑lru, allkeys‑random, volatile‑random, and volatile‑ttl—covers the LRU and LFU algorithms, and outlines the three key expiration deletion methods as well as RDB and AOF persistence handling.
CachingLFULRU
0 likes · 11 min read

This article explains how to configure Redis's maximum memory usage, describes the various eviction strategies such as noeviction, allkeys‑lru, volatile‑lru, and introduces both LRU and LFU algorithms with Java examples and practical configuration commands.
ConfigurationJavaLFU
0 likes · 12 min read

This article explains how to configure Redis's maximum memory usage, describes the various eviction strategies including noeviction, allkeys‑lru, volatile‑lru, random and ttl policies, shows how to query and set these policies via configuration files or commands, and provides Java code for a simple LRU cache while discussing Redis's approximate LRU and LFU algorithms.
ConfigurationJavaLFU
0 likes · 15 min read

This article explains how to set Redis's maximum memory usage via configuration files or commands, describes the built‑in eviction strategies including noeviction, allkeys‑lru, volatile‑lru, allkeys‑random, volatile‑random, volatile‑ttl, and shows how to query and change these policies, while also covering LRU fundamentals, a Java LRU cache example, Redis's approximate LRU implementation, its 3.0 optimizations, and the newer LFU eviction algorithm.
JavaLFULRU
0 likes · 10 min read

This article explains how to set Redis's maximum memory usage via configuration files or runtime commands, details the various eviction strategies including noeviction, LRU, random, and LFU, and provides Java code for a simple LRU cache implementation.
LFULRUeviction policy
0 likes · 10 min read

This article explains how Redis removes expired keys using periodic and lazy deletion, describes the slave expiration handling, details the asynchronous memory reclamation commands like UNLINK and FLUSHALL ASYNC, and outlines the various maxmemory eviction policies including LRU, LFU, and their implementations.
CacheLFULRU
0 likes · 13 min read

Redis 5.0 builds on 4.x with new Stream data type, enhanced memory management, and several command improvements—including XADD, XGROUP, XREADGROUP, XACK, and ZPOPMIN/ZPOPMAX—while also adding LFU/LRU support in RDB snapshots and client‑side enhancements for easier cluster management.
LFULRUcommands
0 likes · 9 min read


ITPUBMar 27, 2017 · Backend Development
This article explains why caching is essential, defines core concepts such as hits, misses, and costs, compares major replacement policies (LRU, LFU, FIFO, ARC, etc.), and provides Java code examples for implementing these algorithms in a backend system.
BackendCacheJava
0 likes · 19 min read

Redis 4.0 introduces a groundbreaking module system for custom data types, improves replication with tag‑based PSYNC, adds an LFU eviction policy, provides non‑blocking UNLINK deletion, and expands memory introspection commands, collectively enhancing performance, flexibility, and extensibility of this popular in‑memory database.
4.0LFUModule System
0 likes · 5 min read

This article explains why caching is essential for high‑performance data retrieval, compares LRU and LFU eviction policies, presents three Redis‑based cache implementations, and discusses consistency challenges and solutions such as eviction ordering, consistent hashing, and delayed eviction in distributed systems.
CachingConsistencyLFU
0 likes · 10 min read


21CTOMar 1, 2016 · Backend Development
This article explains the fundamentals of caching, why caches are needed, describes common replacement policies such as LRU, LFU, FIFO, ARC, and provides Java code examples for each algorithm, helping developers choose and implement the right cache strategy for their applications.
BackendCacheJava
0 likes · 19 min read


21CTOJan 23, 2016 · Backend Development
The article blends a humorous interview scenario with a thorough explanation of caching concepts, including definitions, hit/miss mechanics, eviction strategies, and detailed Java implementations of algorithms such as LFU, LRU, FIFO, ARC, and Random Cache, illustrating how to choose and code cache policies.
CachingJavaLFU
0 likes · 22 min read
