The Fastest Database Query Is the One You Never Execute
Caching explained from first principles — what to cache, where to put it, and why the cheapest query is the one your database never sees.
- System Design Fundamentals
- Caching
- Redis
- Backend
- Performance
- System Design
- Software Architecture
A common assumption in software is: If something is slow, make the database faster.
But that's often the wrong solution. At scale, the biggest performance gains don't come from optimizing queries. They come from avoiding them.
Let's say 100,000 users are viewing the same product page. Without caching, your application might execute the same database query 100,000 times.
- The database works harder.
- Response times increase.
- Infrastructure costs go up.

Now imagine storing that result in memory and reusing it for subsequent requests.
Instead of 100,000 database queries, you might only execute one. That's the power of caching.
One lesson that took me a while to appreciate: Performance isn't just about doing things faster. It's about doing fewer things.
That's why almost every large-scale system relies heavily on caching. Not because databases are slow. But because unnecessary work doesn't scale.
Before optimizing your database, ask yourself:Does this request need to reach the database at all? The answer can completely change your architecture.
Question: What's the biggest performance improvement you've seen from caching?
Keep reading
Every Large-Scale System Is Sacrificing Something
The CAP theorem without the jargon. Every distributed system trades consistency, availability or partition tolerance — the skill is choosing deliberately.
Why Companies Don't Store Everything in One Database
Replication, sharding and read replicas — why large systems split data across many databases, and the trade-offs each strategy forces you to accept.
One Server Is Never the Problem. One Server Is the Risk
A single server is not a performance problem, it is an availability problem. How load balancing removes the single point of failure before it costs you uptime.