Cache-aside (lazy loading) puts the application in control: on a read, it queries the cache; on a hit it returns immediately; on a miss it reads the database, populates the cache, then returns. Only data that is actually requested gets cached, keeping the cache small and relevant. The downsides: the first request for any item always misses (cold cache), and the cache can serve stale data unless you invalidate on writes. It is the most common caching pattern because it is simple and resilient — if the cache fails, the app still works (just slower).
2 / 5
What is the difference between write-through and write-back caching?
Write-through updates the cache and the backing store in the same operation: data is always consistent and the cache is never stale, but every write pays the cost of writing to both. Write-back (write-behind) updates the cache immediately and defers the database write (batched/async): writes are very fast and you can coalesce many updates, but if the cache crashes before flushing, unwritten data is lost. The choice is a classic durability-vs-latency trade-off; write-back suits high-write workloads that can tolerate some risk, write-through suits correctness-critical data.
3 / 5
What does TTL (Time To Live) control in a cache?
TTL is the expiry duration assigned to a cached entry. After the TTL elapses, the entry is considered stale and is either evicted or refreshed on next access. TTL is the primary lever for balancing freshness against load: a short TTL keeps data current but increases backend hits; a long TTL reduces load but risks serving outdated data. It is the simplest invalidation strategy — "let it expire" — and is often combined with explicit invalidation on known writes for data that must be fresh immediately.
4 / 5
What is an eviction policy such as LRU, and why is it needed?
Caches have bounded memory, so when full they must evict something to admit new data. The eviction policy decides what to drop. LRU (Least Recently Used) discards the entry untouched for the longest time, betting that recently-used data is likely to be used again. Other policies: LFU (Least Frequently Used) tracks access counts; FIFO evicts the oldest inserted; TTL-based evicts expired entries first. Choosing the right policy depends on access patterns — LRU is a strong, common default.
5 / 5
What is a cache stampede (thundering herd) and how can it be mitigated?
A cache stampede happens when a hot entry expires and a flood of concurrent requests all miss at once, hammering the database with identical expensive queries — potentially overwhelming it. Mitigations: request coalescing / single-flight (only one request recomputes while others wait for the result), locking on the key during refresh, staggered/jittered TTLs so many keys do not expire simultaneously, and stale-while-revalidate (serve the slightly-stale value while one background request refreshes). These prevent a single expiry from cascading into an outage.
What does the "Caching Strategies" vocabulary exercise cover?
This exercise tests real IT vocabulary related to caching strategies through 5 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 5 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — browse the full vocabulary exercises hub to find related modules covering adjacent IT topics and roles.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.