Complete the code to describe the first step in the cache-aside pattern.
When a request comes in, the system first checks the [1] for the data.
The cache-aside pattern starts by checking the cache for data before querying the database.
Complete the code to describe what happens if data is not found in the cache.
If the data is not in the cache, the system fetches it from the [1].
When cache misses occur, the system retrieves data from the database.
Fix the error in the description of updating the cache after fetching data.
After fetching data from the database, the system [1] the cache with the new data.
The cache-aside pattern updates the cache with fresh data after a database fetch to speed up future requests.
Fill both blanks to complete the cache-aside pattern steps for a write operation.
When data is updated, the system writes to the [1] first, then [2] the cache to keep it consistent.
In cache-aside, writes go to the database first, then the cache is invalidated to avoid stale data.
Fill all three blanks to complete the cache-aside pattern read flow with cache miss handling.
On a cache miss, the system fetches data from the [1], then [2] the cache, and finally [3] the data to the client.
The system fetches from the database, updates the cache, and returns data to the client in the cache-aside pattern.