Recall & Review
beginner
What is the Cache-aside (lazy loading) pattern?
Cache-aside is a caching strategy where the application first checks the cache for data. If the data is missing (a cache miss), it loads the data from the database, stores it in the cache, and then returns it to the user.
Click to reveal answer
beginner
Why is Cache-aside called 'lazy loading'?
Because data is only loaded into the cache when it is requested and not found there. This means the cache is filled on demand, not in advance.
Click to reveal answer
beginner
What happens on a cache miss in Cache-aside pattern?
The application fetches the data from the database, writes it to the cache, and then returns the data to the user.
Click to reveal answer
intermediate
How does Cache-aside handle data updates?
When data is updated in the database, the cache entry is usually invalidated or updated to keep cache and database consistent.
Click to reveal answer
intermediate
What is a potential downside of Cache-aside pattern?
It can cause higher latency on the first request for data (cache miss), and if many requests miss simultaneously, it can overload the database (cache stampede).
Click to reveal answer
In Cache-aside pattern, where is data loaded from when a cache miss occurs?
✗ Incorrect
On a cache miss, the application loads data from the database before storing it in the cache.
What does Cache-aside pattern do when data is updated in the database?
✗ Incorrect
To keep cache and database consistent, the cache entry is invalidated or updated after database changes.
Why might Cache-aside pattern cause a 'cache stampede'?
✗ Incorrect
If many requests miss the cache at once, they all query the database, causing high load called a cache stampede.
Which of these best describes the Cache-aside pattern?
✗ Incorrect
Cache-aside loads data into cache only when requested and missing, hence 'lazy loading'.
What is the first step in Cache-aside pattern when a user requests data?
✗ Incorrect
The application first checks the cache to see if data is available before querying the database.
Explain how the Cache-aside (lazy loading) pattern works step-by-step when a user requests data.
Think about what happens when data is not found in cache.
You got /4 concepts.
Describe how Cache-aside pattern handles data updates to keep cache and database consistent.
Consider what must happen after changing data in the database.
You got /3 concepts.