Order the steps
Order the cache-aside read path for user 42.
- SET user:42 with a TTL
- GET user:42 from Redis
- Return the user to the caller
- On a miss, SELECT the user from PostgreSQL
Choose an answer, then open Show answer below to check it.
Show answer
Answer: B D A C
- GET user:42 from Redis Hit returns immediately.
- On a miss, SELECT the user from PostgreSQL The database is the source of truth.
- SET user:42 with a TTL Next readers hit the cache.
- Return the user to the caller Same result either way.