Node.js · Middle · Question 75 of 75
What is the cache-aside pattern with Redis?
- 1Put the cache in front of the load balancer
- ✓Correct answer: Read from the cache first; on a miss, load from the database, store it in the cache with a TTL and return it
- 3Write every change only to Redis and never to the database
Explanation
On updates, delete or refresh the cached key. A TTL limits how stale data can get, and caching only hot keys keeps memory under control.