Tagged articles
cache invalidation
31 articles · Page 1 of 1
This article explains why cache inconsistency occurs between MySQL and Redis, then analyzes four update patterns—delete-then-update, update-then-invalidate, read/write-through, and write-behind—detailing their execution flows, consistency guarantees, and trade-offs to help choose the best fit for your scenario.
Cache Aside PatternCache ConsistencyData Consistency
0 likes · 9 min read

This article explains why MyBatis second-level cache returns stale data, detailing first and second-level cache mechanics, cache key composition, write timing, namespace isolation issues, statement-level cache controls, Redis implementation, and conditions for safe cache usage.
CacheKeyMyBatisRedis cache
0 likes · 30 min read

This guide explains API caching fundamentals, cache hit vs miss, multi‑layer cache hierarchies, common strategies such as cache‑aside and stale‑while‑revalidate, TTL tuning, event‑driven invalidation, avalanche prevention, HTTP cache directives, and key monitoring metrics to help engineers build resilient, high‑performance services.
API cachingCache strategiesTTL
0 likes · 10 min read

The article analyzes why MySQL and Redis cannot guarantee strong consistency with simple cache‑aside patterns, explains the pitfalls of delayed double delete, and presents a tiered Java design—including transaction‑after‑commit deletion, retryable invalidation, CDC/Outbox pipelines, TTL safeguards, and multi‑level cache considerations—to achieve reliable cache consistency.
CDCConsistencyJava
0 likes · 22 min read

This article walks through 14 real‑world failure scenarios of Spring Boot distributed caching, explains why high cache hit rates are misleading, and provides concrete analysis, code samples, and step‑by‑step recommendations for designing a resilient cache layer that isolates faults, handles hot keys, and ensures data consistency across Redis, local caches, and databases.
High AvailabilityKubernetescache invalidation
0 likes · 37 min read

This article dissects Multica's agent task lifecycle, explaining how a state‑machine model, three‑level watchdog timeouts, a string‑based failure classifier, and precise cache‑invalidation rules together ensure agents run reliably, distinguish between long‑running and stuck tasks, and report progress without overwhelming the network.
Watchdogbackend developmentcache invalidation
0 likes · 10 min read

The article explains how CDN works as a distributed reverse‑proxy cache, details its DNS‑based load balancing, cache‑hit/miss flow, expiration policies and refresh strategies, compares CDN caching with browser and Nginx caches, outlines scenarios where CDN or Redis is appropriate, and provides typical interview follow‑up questions and practical tips.
CDNCachingInterview
0 likes · 13 min read

Prompt Caching in Anthropic's Claude Code replaces repeated processing of identical prompt prefixes with a prefix‑hash cache, slashing input‑token costs by up to 90%, reducing first‑token latency by 79%, and improving throughput, while preserving model output exactly as if no cache were used.
AI EngineeringCache MetricsClaude Code
0 likes · 30 min read

This article presents a production-ready multi-level caching architecture for Spring Boot 3 using Caffeine as L1, Redis as L2, and a database as L3, detailing design goals, hotspot mitigation, consistency handling, failure protection, implementation code, monitoring, and performance evaluation for high-concurrency e-commerce scenarios.
CaffeineHotspot ManagementMulti-level Cache
0 likes · 36 min read

This article examines the common data‑consistency problems that arise when updating both a database and a cache under high concurrency, evaluates four typical write‑order strategies, and presents the most reliable solution—writing to the database first and then safely invalidating the cache using retry, scheduled tasks, MQ, or binlog listeners.
ConsistencyMQRetry
0 likes · 17 min read

This article explains why MySQL master‑slave replication lag causes dirty reads, breaks down the asynchronous replication pipeline, and presents three practical mitigation strategies—including semi‑synchronous replication, forcing reads from the master, and cache double‑delete techniques—so you can choose the right solution for your workload.
MySQLReplication LagSemi‑synchronous
0 likes · 9 min read

This article explains the fundamentals of caching, enumerates various client‑side, server‑side and distributed cache types, describes common caching patterns and expiration policies, and highlights practical considerations to effectively improve web application performance and reliability.
BackendCache strategiesCaching
0 likes · 21 min read

The article details NetEase Cloud Music’s high‑concurrency cache architecture—using lazy‑load, hole‑wrapped objects for penetration protection, placeholder values for missing data, horizontal and vertical scaling with consistent hashing, and asynchronous binlog‑driven invalidation—to achieve sub‑millisecond reads for a read‑heavy, write‑light music library.
CachingScale-outcache invalidation
0 likes · 12 min read

This article demonstrates how to achieve cache‑database consistency by updating MySQL first, deleting Redis cache asynchronously via Canal, publishing change events to RabbitMQ, and handling acknowledgments manually in a Spring Boot application, complete with configuration steps and troubleshooting tips.
CanalMessage QueueMySQL
0 likes · 11 min read

This article examines the challenges of keeping cache and database data synchronized, categorizes data by real‑time requirements, and evaluates four cache‑write strategies—updating the database first, deleting cache first, and their variations—highlighting their advantages, pitfalls, and practical solutions such as delayed double deletion, forced master reads, and binlog‑driven cache updates.
Cache Consistencycache invalidation
0 likes · 8 min read

The article analyzes three data‑level classifications, examines four cache‑database write strategies, discusses their pros and cons, and presents practical solutions such as delayed double deletion, message‑queue compensation, and binlog‑driven cache updates to maintain consistency.
Message Queuecache invalidationdatabase consistency
0 likes · 8 min read

This article explains why Redis client‑side caching is needed, how the tracking feature works under different modes, and what trade‑offs each mode presents for memory, CPU, and network usage, helping developers design efficient caching architectures.
Client Side CachingPrefix TableRESP3
0 likes · 10 min read

Meta engineers describe the challenges of cache invalidation and consistency in large‑scale distributed systems, explain why stale caches are problematic, present their Polaris observability service and consistency‑tracking techniques, and detail how they raised TAO’s cache consistency from six‑nines to ten‑nines.
CachingConsistencyObservability
0 likes · 17 min read

This article presents a comprehensive overview of cache optimization techniques, covering benefits and costs, update policies, granularity control, penetration and avalanche mitigation, hot‑key reconstruction, and distributed batch‑operation strategies, with practical examples using Redis and MySQL.
BackendCachingcache invalidation
0 likes · 14 min read

This article examines the challenges of maintaining consistency between databases and caches during high‑concurrency writes, compares four common update strategies, highlights their pitfalls, and recommends the most reliable approach with practical retry mechanisms.
Consistencycache invalidationhigh concurrency
0 likes · 17 min read

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.
BackendCacheData Consistency
0 likes · 10 min read

This article explains how caching can accelerate read/write performance and reduce backend load, analyzes its benefits and costs, discusses update strategies, granularity control, and solutions for common problems such as cache penetration, empty‑hole, avalanche, and hot‑key reconstruction, providing practical guidelines for robust backend design.
Backend Performancecache invalidationdistributed systems
0 likes · 14 min read

This article explains the motivation for client‑side caching, what data should be cached, and details the Redis tracking feature—including normal, broadcast, and redirect modes—while providing implementation examples and best‑practice guidelines for reducing latency and load on Redis servers.
BackendClient Side Cachingcache invalidation
0 likes · 9 min read

This article examines the characteristics of Redis and Memcached as distributed cache solutions, outlines common design pitfalls such as consistency, cache penetration, breakdown, avalanche, and hot‑key issues, and provides practical strategies—including consistent hashing, binlog‑driven invalidation, message‑queue indexing, and lock mechanisms—to build reliable and high‑performance caching layers in backend systems.
Cache ConsistencyMemcachedcache invalidation
0 likes · 18 min read

After changing a project's JDK in IntelliJ IDEA, imports of your own classes may appear in red despite the code compiling, but you can eliminate these false errors by invalidating caches and restarting the IDE, as detailed in this step‑by‑step guide.
Import ErrorsIntelliJ IDEAJDK Configuration
0 likes · 2 min read

The article examines the risks of using the dangerous FLUSHDB command in Redis, explores common alternatives like SCAN, async deletion, and expiration, and proposes a secondary‑index solution using sets and sorted sets to efficiently invalidate only the affected cache entries without blocking the service.
FLUSHDBcache invalidationdata structures
0 likes · 11 min read

This article examines three common cache‑update approaches—updating the cache after the database, deleting the cache before updating the database, and updating the database then deleting the cache—analyzes their drawbacks, and presents practical solutions such as delayed double‑delete and retry mechanisms to ensure data consistency.
BackendCacheConsistency
0 likes · 10 min read

This article explains why caching is essential for backend services, outlines common cache problems such as penetration, concurrency, and avalanche, and compares cache-aside, read/write‑through, and write‑back patterns with practical guidance on choosing and updating caches.
BackendCachingcache invalidation
0 likes · 8 min read

An order system retrieved incorrect product size data due to master‑slave database lag causing stale Redis cache, and the article explains the original flawed flow, the revised solution that writes to cache during sync, and best practices for cache updates, read‑through, and QA testing.
Master-Slave ReplicationRead-Write Separationbackend architecture
0 likes · 5 min read

This article explains the fundamentals of web caching, covering cache concepts, hit and miss workflows, expiration handling, conditional validation methods, and multi‑level cache strategies used in HTTP to improve performance and ensure data freshness.
Cache ControlConditional RequestsHTTP caching
0 likes · 15 min read

This article examines various techniques for proactively refreshing Memcached entries before they expire, including dual‑key schemes, timestamp‑based checks, and lock‑based updates, and presents a preferred Java implementation that minimizes cache‑stampede and reduces memory overhead.
ConcurrencyJavaMemcached
0 likes · 7 min read
