System Design
Add a Redis cache, or tune the database first?
Tuning fixes the cause: missing indexes, N+1 queries and slow plans often account for most of the latency and cost nothing to run. A cache absorbs repeated reads of hot data and protects the database at scale, but adds invalidation, staleness and another system to operate.
- Tune queries and indexes
- Add a Redis cache
Not yet editorially reviewed AI-assisted4 sources