This article analyzes why Eureka’s default three‑level caching causes slow service deregistration, calculates the worst‑case detection time, and provides configuration tweaks to dramatically shorten the shutdown latency in Spring Cloud microservices.
Redis caching can suffer from avalanche, breakdown, and penetration anomalies, but using staggered expirations, mutex locks, double‑key backups, high‑availability clusters, rate limiting, empty‑value caching, Bloom filters, warm‑up and degradation strategies effectively mitigates these risks and protects database stability.
This article examines common Redis caching challenges in Java high‑performance architectures—such as lock loss, cache hot‑spot rebuild, cache penetration, and avalanche—through eleven real‑world scenarios, and provides practical solutions including RedLock alternatives, Zookeeper, DCL, tryLock, multi‑level caching, and Lua‑based read‑write locks.
This article examines how Ctrip's hotel query service selects and optimizes in‑memory cache structures—covering Java object layout, HashMap overhead, alternative collections, and various encoding techniques—to achieve high‑performance reads and updates while drastically reducing memory consumption.
This article explains the definitions of Linux buffers and cache, how the free command reports them, and demonstrates through experiments that buffers can cache both reads and writes while cache primarily handles page caching for file reads and writes.
This article explains MyBatis first‑ and second‑level caching, demonstrates how join queries can cause stale data when only the updated mapper's cache is cleared, and introduces a custom @CacheRelations annotation with a RelativeCache implementation that propagates invalidation across related mappers.
This article revisits cache breakdown, penetration, and avalanche issues in high‑concurrency Java applications, critiques common Bloom‑filter solutions, and demonstrates practical Spring Boot techniques—including null‑value caching, sync annotations, and TTL jitter—to implement robust, production‑ready caching without complex infrastructure.
This article explains the principles and practical usage of MyBatis first‑level and second‑level caches, describing how caching reduces database load, showing configuration steps, code demonstrations, flow diagrams, and important considerations such as cache invalidation and LRU eviction.
This article explains the concepts of MyBatis first-level and second-level caches, demonstrates how they work with practical Java code, shows configuration methods, and highlights important considerations such as cache invalidation and eviction policies.
This article explains the Caffeine local cache library, its W‑TinyLFU eviction algorithm, how it improves on Guava Cache, and provides detailed examples of manual, synchronous, and asynchronous loading, eviction policies, reference types, statistics, and Spring Boot integration with code snippets.
This article examines the problem of data inconsistency when writing to both a database and a cache, outlines four typical dual‑write strategies, analyzes their drawbacks in high‑concurrency scenarios, and recommends the most reliable approach—writing to the database first followed by cache deletion with retry mechanisms.
This comprehensive guide explores Redis fundamentals, including NoSQL concepts, its five primary data structures, internal storage mechanisms, persistence options, replication, sentinel failover, and strategies to prevent cache penetration, breakdown, and avalanche, providing developers with deep insights for building robust, high‑performance applications.
Consistent hashing maps both servers and keys onto a virtual hash ring, allowing keys to be assigned to the nearest clockwise server, which minimizes data movement during node addition or removal, improves load distribution with virtual nodes, and is widely used in distributed caching and load balancing systems.
The article analyzes various cache update strategies—including delete‑then‑write, write‑then‑delete, and asynchronous binlog subscription—examining their impact on system throughput, concurrency safety, failure scenarios, and fault detection to ensure data consistency between cache and database.
A recent flash‑sale failure caused by a cache avalanche was analyzed, revealing that setting a uniform two‑hour expiration for all items flooded the database, and the post outlines detection steps, emergency mitigation, and three proven techniques—uniform expiration, mutex locking, and never‑expire caches—to prevent recurrence.
This article explains how to enhance Spring Cache by creating custom cache annotations, replacing the costly KEYS command with SCAN in a rewritten DefaultRedisCacheWriter, and dynamically registering RedisCacheManager beans to support per‑module TTL and transaction‑aware caching, all illustrated with full Java code examples.
This article explains why caching is essential for high‑concurrency systems, analyzes the challenges of keeping database and cache data consistent, and compares five practical cache‑invalidation strategies—including write‑after‑DB, delete‑before‑write, delayed double delete, queue‑based deletion, and binlog subscription—highlighting their trade‑offs and suitable scenarios.
The article analyzes the problem of data inconsistency when using caches such as Redis or local memory alongside a database, classifies data by real‑time requirements, compares four write‑through/write‑behind strategies, and proposes practical solutions like delayed double‑delete, message‑queue compensation, and binlog‑driven cache updates.
Redis is an open‑source, in‑memory data‑structure store that serves as a database, cache, and message broker; this guide introduces its fundamentals, explains why NoSQL emerged, details its five primary data types, common commands, and advanced features like transactions and pipelines.
The article walks through Redis’s two persistence options—RDB snapshots and AOF logs—detailing how each works, their advantages and drawbacks, and why interviewees should understand their differences, including AOF rewrite compression, to answer interview questions accurately.
This article explains the key concepts, simple design, practical steps, and multiple solution patterns—including front‑end scaling, cache‑based concurrency control, and database handling—used to build a reliable high‑traffic flash‑sale system.
This article explains how to guarantee that insert and update messages belonging to the same data entity are consumed in the correct order across separate Kafka topics by applying fine‑grained (or distributed) locks and a cache‑based detection mechanism, complete with Java/Spring code examples.
This article explains MyBatis's first‑level and second‑level caching mechanisms, demonstrates data inconsistency problems caused by joined‑table queries, and provides a custom annotation‑driven relation cache solution with code examples for configuring and validating the cache behavior.
The article analyzes the challenges of maintaining data consistency when using both cache (local memory or Redis) and a database, classifies data by real‑time requirements, evaluates four double‑write strategies, and proposes practical solutions such as delayed double deletion, message‑queue compensation, and binlog‑driven cache updates.
Shopee’s engineering team scaled a 100‑node Apache Druid cluster for real‑time OLAP by redesigning the Coordinator load‑balancing algorithm, adding incremental metadata pulls, introducing a segment‑merged result cache, and building exact‑count and flexible sliding‑window operators, while planning cloud‑native deployment.
This document presents the background, objectives, research findings, design principles, API specifications, caching strategy, implementation details, XML usage, memory impact analysis, and conclusions of a unified rich‑media animation component that consolidates image, GIF, Lottie, pager and video handling for efficient reuse in Android RecyclerView lists.
This article explains how WKWebView leverages various WebKit cache types—including disk, memory, and page caches—detailing their structures, sizing strategies, eviction policies, and the exact source‑code logic that governs HTTP caching, cleanup, and validation on iOS.
This article introduces Caffeine Cache as a high‑performance replacement for Guava Cache, explains its W‑TinyLFU eviction algorithm, demonstrates various loading and eviction strategies with code examples, and shows how to integrate and configure it in Spring Boot applications.
The article details how Tencent Cloud’s K‑Song feed service, serving over 150 million daily users, was engineered with a read‑expansion model, cached results, auxiliary index tables, hashed sharding, write‑concern tuning, disabled chain replication, and WiredTiger and backup optimizations, achieving sub‑10 ms write latency and significantly lower CPU and slow‑query rates.
This article explains why caching improves performance, examines the trade‑offs between cache utilization and data consistency, analyzes concurrency‑induced inconsistency scenarios, compares update‑then‑delete versus delete‑then‑update approaches, and recommends asynchronous retry with message queues or binlog subscription to reliably keep cache and database in sync.
This article explains how Redis cache can suffer from key expiration, eviction, and high‑concurrency problems such as cache breakdown, penetration, and avalanche, and presents practical lock‑based, filter‑based, and timing‑aware solutions to maintain backend stability and performance.
This article provides a comprehensive overview of CPU caches, covering why they are needed, their classification, placement and lookup mechanisms, replacement and write policies, and coherence protocols such as MESI, illustrating each concept with diagrams and code examples.
This article explores the role of cache in computer architecture, covering why caches are needed, how data is placed and retrieved, various replacement policies, write strategies, and consistency protocols such as MESI, while illustrating concepts with diagrams and code examples.
This article explains the motivation behind CPU caches, describes their placement in the memory hierarchy, details cache organization, placement policies, lookup mechanisms, replacement strategies, write handling, and coherence protocols such as MESI, providing a comprehensive overview of cache fundamentals.
This guide explains how to persist Docker layer caches in GitLab CI pipelines on Kubernetes by deploying a standalone Docker‑in‑Docker service with a Local Persistent Volume, configuring a Service for access, updating CI jobs, and adding a CronJob to prune old images.
This article demonstrates how to design and implement a high‑frequency like/unlike feature using Spring Cloud, Redis for caching, MySQL for persistence, and Quartz for scheduled data synchronization, covering cache design, data structures, service interfaces, database schema, and deployment scripts.
The session_cache_limiter function returns the current cache limiter name, defines HTTP cache‑control policies such as nocache, public, and private, accepts an optional limiter argument, and can be used in PHP scripts to control client and proxy caching behavior.
This article explains the PHP function session_cache_expire(), describing its purpose of returning the current session cache expiration value in minutes, its optional parameter for setting a new expiration time, the default return value, and provides a complete example demonstrating how to configure and display the cache limiter and expiration settings.
This article explains Eureka Server's three-tier cache system—including read‑only, read‑write, and local registry caches—detailing their structures, update mechanisms, expiration policies, configuration options, and the consistency challenges they introduce for microservice environments.
This article introduces Bloom filters—a space‑efficient probabilistic data structure—for fast set membership testing, explains their underlying hash‑based mechanism, showcases Java implementation with Google Guava, and demonstrates their application in scenarios such as cache‑penetration protection.
The article explains why cache breakdown, penetration, and avalanche occur under high concurrency, analyzes their root causes such as key expiration and eviction, and provides practical mitigation techniques including distributed locking, Bloom filters, and staggered key updates to keep services stable.
This article analyzes the Go‑implemented FreeCache library, detailing its project features, internal data structures, zero‑GC design, segment‑based locking for high‑concurrency thread‑safe access, the set operation workflow, index expansion, and its approximate LRU eviction strategy.
The article explains why cache breakdown, penetration, and avalanche occur in high‑concurrency Redis environments, and presents practical mitigation techniques such as distributed locking, Bloom‑filter filtering, and careful expiration strategies to keep backend services stable.
This article explains how Eureka's service registry works, detailing the client’s initial full‑registry fetch during startup, the server’s two‑level caching strategy, and how both sides store and retrieve registration information for efficient service discovery.
This article explains how a Eureka client initially retrieves the full service registry from the server, the conditions that trigger a full fetch, and how the server caches the registry using a two‑level read‑only and read‑write cache architecture.
This article explains how Linux manages process memory, covering allocation via mmap and brk, OOM killer selection, the role of page cache in different mapping types, manual and automatic memory reclamation, and related kernel parameters.
This article provides a comprehensive overview of cache memory, explaining why caches are needed, their placement strategies, operation principles, replacement policies, write handling methods, and coherence protocols such as MESI, offering essential knowledge for computer architecture and system design.
This article provides a comprehensive overview of Redis, covering its definition, basic and special data structures, performance optimizations, expiration and eviction policies, common application scenarios, persistence mechanisms, high‑availability architectures, distributed lock implementations, transaction handling, and related algorithms such as Redlock and Bloom filters.
This article provides a comprehensive list of typical Redis interview questions covering its features, performance, data structures, supported data types, common use cases, eviction policies, persistence methods, clustering, high‑availability mechanisms, transaction handling, and comparisons with local caches like Guava and Caffeine.
This article explains iQIYI TV's backend distributed real-time local cache solution, comparing local and centralized caches, detailing its advantages, drawbacks, and a message-driven update mechanism that improves high‑concurrency read performance and reduces cache‑related risks.
This article explains the purpose of CPU caches, their classification, placement and replacement strategies, write policies, and coherence protocols, providing a comprehensive overview of cache concepts essential for modern computer architecture.
iQIYI TV’s backend implements a distributed real‑time local cache that combines hotspot local storage with a unified messaging bus, management console, and business‑filtering to deliver instant updates, improve hit rates, reduce read‑bottleneck risk, and alleviate load on centralized caches under extreme concurrency.
This article explains Redis's virtual memory (VM) feature, how it swaps cold data to disk while keeping keys in memory, details configuration parameters, describes the two threading models for data swap-in/out, and highlights why Redis's custom VM implementation boosts performance.
This article explains the DNS hijacking threat, shares a real incident affecting NetEase Cloud IM, and details a comprehensive high‑availability architecture—including HttpDNS, laddered HTTP requests, caching strategies, and SNI handling—that protects the SDK from DNS attacks and ensures reliable service.
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.
The article explains the concepts of cache penetration, cache breakdown, and cache avalanche in Redis‑based systems, analyzes the performance problems they cause under high concurrency, and presents practical mitigation techniques such as Bloom filters, caching empty objects, distributed locks, high‑availability clusters, rate limiting, and data pre‑warming.
Vivo Mall transformed its monolithic coupon component into an independent, sharded microservice through a rolling, dual‑write migration, employing Redis distributed locks, batch inserts, multi‑level caching, and read‑write splitting to eliminate bottlenecks, achieve non‑downtime deployment, and deliver scalable, high‑performance coupon handling for future growth.
This article introduces the various Redis eviction strategies—including volatile-ttl, volatile-random, volatile-lru, volatile-lfu, allkeys-random, allkeys-lru, and allkeys-lfu—explains their behavior, shows where they are configured in redis.conf and the initServer source code, and notes the default noeviction policy when memory exceeds maxmemory.
This article walks you through using an Android phone to locate Xianyu’s video cache folder, rename the hidden file to MP4, and play or save the downloaded cat video, providing clear screenshots for each step.
The article introduces Youzan's Transparent Multilevel Cache (TMC), detailing its three‑layer architecture, hotspot detection and local caching mechanisms, integration approaches for Java applications, stability and consistency features, and performance results from real‑world e‑commerce campaigns.
The article explains the concepts of cache penetration, cache breakdown, and cache avalanche in Redis‑based systems, describes the performance risks they pose to persistent databases, and presents practical mitigation techniques such as Bloom filters, empty‑object caching, hot‑key permanence, distributed locks, high‑availability clusters, rate limiting, and data pre‑warming.
The Transparent Multilevel Cache (TMC) solution adds application‑level hotspot detection, local caching, and hit‑rate statistics to a standard distributed cache stack, enabling automatic hotspot discovery, reducing load on backend cache clusters, and improving system stability and latency during traffic spikes.
This article outlines the main server hardware architectures—SMP, UMA, and NUMA—explains shared-storage models, details multi-core cache structures from private L1 to shared L3, compares access latencies, and discusses inter-core communication mechanisms and cache coherency protocols.
At Gopher China 2021, Go expert Yang Le Duo presented a detailed exploration of a proactive in‑memory cache architecture, describing how his team tackled real‑time data, complex queries, hot‑cold data swapping, and language constraints to improve performance and developer productivity in large‑scale streaming applications.
This article introduces Spring Cache as a framework‑agnostic caching abstraction that eliminates manual cache code, explains its core concepts, annotations, configuration options, and demonstrates practical usage with Redis and custom key, condition, and eviction strategies in Spring Boot applications.
This article introduces Caffeine Cache, explains its W‑TinyLFU eviction algorithm, compares it with Guava, and provides detailed usage examples—including manual, synchronous, and asynchronous loading, eviction policies, Spring Boot integration, annotations, and configuration snippets—for building high‑performance backend caches.
This guide demonstrates how to add a custom AOP‑based caching layer to a SpringBoot application, using Redis to store frequently queried MySQL table data, defining @AopCacheEnable and @AopCacheEvict annotations, implementing an aspect, handling key generation, expiration, and cache eviction on CRUD operations.
The article introduces the pain points of using Redis at Tencent IEG, explains the three Tendis product editions, and provides an in‑depth description of the hybrid storage version’s architecture, components, version control, cold‑hot data interaction, scaling mechanisms, and the stateless Redis‑sync layer.
This article introduces the pain points of using Redis as a cache, presents Tencent's Tendis solution with its three product variants, and provides an in‑depth explanation of the hybrid storage version’s overall architecture, component functions, version control, cold‑hot data interaction, eviction policies, and scaling mechanisms.
The article introduces Transparent Multilevel Cache (TMC), a comprehensive caching solution that adds hotspot detection and local caching to existing distributed cache systems, explains its three‑layer architecture, transparent Java integration, real‑time hotspot discovery process, and demonstrates performance gains in high‑traffic e‑commerce scenarios.
The article introduces Youzan's Transparent Multilevel Cache (TMC), explains why hotspot cache access harms e‑commerce applications, describes its three‑layer architecture, details the Java client integration with Hermes‑SDK for automatic hotspot detection and local caching, and presents real‑world performance gains during large‑scale promotional events.
This article explains cache‑database consistency challenges, outlines three classic caching patterns, compares delete‑versus‑update strategies, discusses operation ordering, and presents three practical solutions—including delayed double delete, retry mechanisms, and binlog‑based asynchronous eviction—to help maintain data integrity in distributed systems.
This article explains the concepts of strong, weak, and eventual consistency, introduces three classic cache patterns (Cache‑Aside, Read‑Through/Write‑Through, Write‑Behind), and discusses practical strategies such as delayed double‑delete, retry mechanisms, and binlog‑based asynchronous eviction to keep Redis and MySQL data in sync.
This article explains how UCloud's US3 object storage, combined with a custom Hadoop adapter, separates compute and storage, optimizes file system operations, and leverages caching and specialized APIs to dramatically reduce storage costs and improve read/write performance for large‑scale Hadoop workloads.
The article explains Youzan's Transparent Multilevel Cache (TMC), a solution that automatically detects cache hotspots, adds an application‑level local cache, and provides hit statistics to reduce load on distributed caches, improve consistency, and boost performance for high‑traffic e‑commerce scenarios.
The article explains Youzan’s Transparent Multilevel Cache (TMC), detailing its architecture, hotspot detection, local caching, consistency mechanisms, and real‑world performance gains during flash‑sale events, showing how it reduces cache pressure and improves latency for Java‑based services.
This case study details how integrating JuiceFS with Presto reduced HDFS cluster load by about 26%, achieved over 90% cache hit rate for ad‑hoc queries, and lowered average query latency by roughly 13%, while simplifying operations and improving system stability.
The article explains the purpose and structure of the memory hierarchy—from ultra‑fast registers and caches inside the CPU, through volatile main memory, to slower non‑volatile disks—showing how programs are loaded, executed, and how virtual memory and locality principles extend usable memory beyond physical limits.
This article explains the architecture and core mechanisms of Eureka, a service registry used in Spring Cloud micro‑service environments, covering server components such as Lease and caching, client registration and discovery processes, self‑preservation mode, consistency trade‑offs, and comparisons with other discovery solutions.
This guide outlines Redis's fundamental limitations, common performance issues such as big keys, slow queries, and connection‑pool exhaustion, and provides practical recommendations on architecture, configuration, and operational diagnostics to help developers avoid hitting Redis's boundaries.
This article explains how bitmap and Bloom filter data structures reduce memory usage for large integer sets, demonstrates a Java bitmap implementation, and explores high‑concurrency cache design, consistency, penetration, and avalanche problems with practical mitigation techniques.
This article explains Spark's cache and checkpoint mechanisms, detailing when to use each, how they are implemented internally, how cached and checkpointed RDDs are stored and retrieved, and the differences between caching, persisting, and checkpointing for reliable big‑data processing.
The article shares eight authentic production incident cases—from frequent JVM Full GC and memory leaks to cache avalanches, DNS hijacking, and database deadlocks—detailing their root causes, diagnostic steps, code snippets, and practical remediation strategies for engineers facing similar challenges.
This article examines cache consistency challenges in Redis-backed systems and compares several update strategies—including TTL, delayed double‑delete, cache‑aside, and message‑queue approaches—detailing their workflows, code examples, advantages, and drawbacks to guide backend developers toward reliable cache invalidation.
This guide explains how the Linux free command reports memory usage, clarifies the roles of total, used, free, buffers, and cache, describes the meaning of the -/+ buffers/cache line, and provides practical steps to clear swap and drop caches.
This article explains how to create a simple single‑node in‑memory cache that supports per‑entry expiration by defining a generic cache interface and implementing it with Caffeine, using ConcurrentHashMap to store multiple caches keyed by expiration time.
This guide explains how to interpret the Linux free command, clarifies the roles of total, used, free, shared, buffers, and cached memory, and provides practical commands to clear swap and drop caches for better system performance.
The article reviews common cache‑side data‑sync patterns, highlights their inconsistency and data‑loss risks under high load, and presents JD's solution that combines Cache‑Aside, Change Data Capture, message queues, delayed consumption, versioning, and persistence to ensure eventual consistency between cache and relational databases.
This article explains the LRU cache eviction algorithm, its core principle, real‑world applications in Redis and MySQL, compares naive array and linked‑list solutions, and provides a complete O(1) doubly‑linked‑list‑plus‑hash‑map implementation in Python for interview preparation.
This guide walks through customizing Nginx 404 error pages, enabling and reading the stub_status module, increasing worker processes and connections, adjusting kernel limits, expanding header buffers, and configuring browser caching for static assets to dramatically improve server performance and reliability.
This article explains how RedisSyncer enables fast, reliable cross‑version and cross‑cluster Redis data migration in multi‑cloud environments, addressing challenges such as version mismatches, node inconsistencies, and rapid rollback while improving access speed and reducing database load.
This article explains why cache‑database inconsistencies occur in large systems, details the cache‑aside, read‑through, write‑through and write‑behind strategies, highlights three common pitfalls with concrete examples, and offers practical recommendations such as proper update ordering and cache expiration to ensure data freshness.
This article provides a comprehensive analysis of the Caffeine Java caching library, covering its performance‑focused W‑TinyLFU eviction algorithm, detailed source‑code walkthroughs of frequency sketching, read/write buffers, timer‑wheel expiration, and practical usage examples compared with Guava Cache.
This article provides a comprehensive analysis of ThinkPHP’s cache system, detailing the execution flow for setting and retrieving cache, exploring the underlying source code, illustrating static method behavior, initialization, file handling, compression techniques, and practical examples with code snippets.
This article explains Caffeine, a high‑performance Java local cache, comparing it with Guava Cache, detailing its W‑TinyLFU eviction policy, asynchronous read/write buffers, timer‑wheel expiration, and provides extensive source code analysis to illustrate its design and optimization techniques.
Caffeine is a high‑performance Java 8 local‑cache library that replaces Guava by using the W‑TinyLFU algorithm with three‑queue LRU structures and lock‑free read/write buffers, offering extensive configuration, dynamic runtime adjustments, and safe back‑source loading with distributed locks to prevent cache‑stampede.
This article provides a detailed, practical guide to optimizing HBase in production, covering table pre‑splitting, RowKey design, JVM memory and GC settings, MSLAB and BucketCache configuration, read‑side client and server tuning, write‑side strategies, and additional tips such as compression and scan caching.
The article explains the concepts of cache penetration, cache breakdown, and cache avalanche in Redis, illustrates each problem with real‑world analogies, and presents practical mitigation techniques such as null caching, Bloom filters, mutex locks, asynchronous refresh, varied TTLs, and clustering to ensure robust backend performance.