Understanding Cache Expiration Policies
Which cache invalidation strategy relies on specifying a time-to-live (TTL) after which cached data is considered stale, regardless of data changes?
- Time-based expiration
- Client-invalidate pattern
- Adjecent cache update
- Write-through caching
- Eventual consistancy
Write-Through vs Write-Behind Caching
In a write-behind cache strategy, when is data written to the underlying data store?
- Data is written asynchronously after being updated in cache
- Data is written immediately before updating the cache
- Data is never written to the data store
- Data is deleted from cache and main store at the same time
- Data is written only on cache miss
Cache Invalidation in Distributed Systems
What is a major challenge of using a cache invalidation strategy in a distributed multi-node system?
- Ensuring all nodes receive invalidation notifications simultaneously
- Implementing least recently used (LRU) eviction
- Storing the entire dataset in memory
- Using strong encryption for cache data
- Avoiding frequent cache hits
Trade-offs with Manual Invalidation
Which is a significant trade-off of using manual cache invalidation?
- Requires developers to accurately identify and clear stale cache entries
- Caches are always updated automatically
- Leads to increased disk I/O operations
- Reduces application runtime errors
- Forces cache expiration to zero
Understanding Cache Coherency
Which phrase best defines cache coherency in the context of cache invalidation?
- Keeping cached data consistent with the original data source
- Ensuring the cache server has a large enough disk
- Running cache warmup scripts automatically
- Using only strong consistency models
- Periodic purging of the entire cache
Invalidation Using Event-based Notifications
In which scenario would event-based invalidation be preferable over time-based expiration?
- When changes to the underlying data are unpredictable and need immediate reflection in cache
- When database reads far outnumber writes
- When cache size needs to be minimized
- When cache misses are not acceptable
- When cache eviction must be random
Potential Risks of Stale Data
What is a potential drawback of using only time-based cache invalidation?
- Users may receive stale data before TTL has expired
- Data will always be served fresh from the database
- Increased risk of cache snowballing
- High CPU utilization on the cache server
- Cache misses will become impossible
Cache Busting Techniques
What does cache busting generally refer to in web caching?
- Forcing the retrieval of new or updated data and ignoring the existing cache
- Increasing cache size
- Encrypting cached files
- Serving outdated resources to save bandwidth
- Reducing database availability
Using Cache Keys for Invalidation
Given a scenario where product details may frequently change, how can cache key versioning assist in cache invalidation?
- By updating a version suffix on the key when data changes, forcing cache refresh
- By storing cache keys on disk
- By decreasing cache lookup speed
- By eliminating the need for a data store
- By increasing cache miss rates deliberately
Lazy Invalidation Pattern
What is a key characteristic of the lazy invalidation cache pattern?
- Cache entries are checked for freshness only when accessed
- All cache entries are proactively cleared on every write
- Cache data is never removed automatically
- Database updates are rejected if cache is not updated
- Writes are only allowed after cache is empty