No Caching: Why Repeated Fetches of the Same Data Slow Systems Down
A system that keeps fetching the same slow-changing data for every visitor wastes work, delays answers, and struggles when traffic grows.
In short
No Caching is a performance antipattern where a system keeps fetching the same slow-changing data for every visitor instead of keeping a copy.
12 min readFree
What You Will Learn
This lesson covers a common design mistake called No Caching. It happens when a system goes back to the original source of its data again and again, even though the answer hardly ever changes. You will learn how to spot the mistake, why it hurts, and how to fix it at a high level. A news site example shows the fix from start to finish. Here are the key words first.
Key words
- Antipattern
- A common design mistake that seems reasonable at first but causes trouble when the system is busy.
- Cache
- A small, fast store that keeps copies of data close to the place that needs it.
- Origin
- The place where data truly lives, such as a database, an outside service, or a calculation.
- API
- Application Programming Interface. A set of rules that lets one program ask another program for data.
- Latency
- The time between asking for something and getting the answer.
- Cache hit
- A request that the cache answers from its stored copy.
- Cache miss
- A request the cache cannot answer, so the system must go to the origin.
- Hit ratio
- The share of all requests that the cache answers. It is hits divided by all lookups.
- TTL
- Time To Live. How long a cached copy stays valid before it is removed.
- Stale data
- A cached copy that no longer matches the original data.
- Invalidation
- Removing or refreshing a cached copy when the original data changes.
What Is the No Caching Antipattern?
Microsoft's Azure Architecture Center keeps a catalog of performance antipatterns. In that catalog, No Caching is described in just a few words: failing to cache data. The idea is simple. An application asks for the same information over and over, and it never keeps a copy for the next visitor.
Put in plain terms, the app tier repeats work it could have reused. It either fetches the same record from the database again, or it recalculates a result that stayed the same. Azure's guidance points out that data that is read often is a candidate for caching.
The mistake is not about one slow query. It is about the pattern: many requests, the same answer, and no reuse. A system can look fine with a handful of users and then fail when traffic grows. That is why this antipattern is easy to miss during early testing.
Three signs point to this antipattern. Look for them in your own system.
Repeated identical reads
Many visitors ask for the same page, record, or list, and each request travels all the way to the database.
Heavy load on the data source
The database's work, its query count, or an outside API's quota climbs as traffic grows, even though the data has not changed much.
Slow answers for slow-changing data
A product list that changes once a month still takes time to load on every single page view, and that delay adds up.
Signs You Can Spot
The three signs above are the first clues. Use them to ask a practical question: is this data read many times but written rarely? If the answer is yes, a cache may help. If the data is read once and then changed, a cache adds little.
Metrics That Reveal It
Guessing is risky, so measure the system. Azure's guidance says an application should always record cache hits and cache misses, and then use those counts to tune what gets cached and for how long. The main number is the cache hit ratio. It is calculated as hits divided by all lookups, so a higher ratio means the cache answers more requests.
A low ratio is a warning. Another useful number is the raw query count. If the same query runs thousands of times and returns the same rows, the antipattern is likely present.
- 1
Take inventory
List each database, API, and calculation the app uses. Note whether any cache sits in front of it.
- 2
Judge how often data changes
Mark the data that changes slowly. Those items are the best candidates for caching.
- 3
Watch live traffic
Count how often each request fetches the same data in production.
- 4
Run a load test
Use realistic traffic in a test environment to see how responses slow as load rises.
- 5
Compare data-access statistics
Look at the database's own reports and find the same requests repeated many times.
Why Does It Hurt?
Every request that skips the cache travels to the slowest and most expensive layer in the system. That one habit causes three kinds of harm. Each harm grows as more people use the product.
Slower answers for users
Each trip to a database or outside API adds delay. Microsoft's guidance notes that repeated fetches from costly resources raise both input-output overhead and latency.
Wasted resources and cost
Repeated work uses processor time, network capacity, and database time. Some services also charge for each data access, so the bill grows with every repeated read.
Less room to grow
When every request hits the same source, the source becomes the limit. Azure guidance warns about contention in the data store, poor response times, and outside services that throttle clients past a quota.
Azure's broader performance guidance says that common practices like this one tend to cause scalability problems when an application is under pressure. It is to stop paying the full cost of the same answer again and again.
How Does the Hit Ratio Math Work?
A cache does not remove all load. It removes the share of requests it can answer. The ratio must be read with the total traffic in mind.
Try smaller numbers. If 10,000 requests arrive each second and the cache answers 90 percent of them, the database sees only 1,000 each second. If the cache answers only 50 percent, the database still gets 5,000. The same cache can feel very different depending on its hit ratio.
In words: the hit ratio equals the number of cache hits divided by the number of hits plus the number of misses.
How Do You Fix It?
The fix is not to cache everything. It is to choose the right data, give each copy a limited life, and accept some staleness on purpose. Microsoft's guidance calls the on-demand, or cache-aside, approach the most popular strategy. In that approach, the app checks the cache first, loads from the source on a miss, and clears old entries when the data changes. Cache-aside has its own lesson, so here you only need the big picture.
Decide What Is Safe to Cache
Read-heavy data
Items that many people read but few people change are the best candidates.
Slow-changing reference data
Things like a category list or a store's settings change rarely, so a copy stays correct for a long time.
Data that is expensive to build
A result that takes a lot of work to compute can be kept and reused, as long as the inputs rarely change.
Sensitive or personal data
Private details are risky in a shared cache, so they should be loaded from the main source each time.
Data that changes every second is usually a poor fit. Live stock prices or sensor readings change so fast that a stored copy is wrong almost at once. Caching is also a poor fit for data that is almost never read. Microsoft's cache-aside guidance advises against storing sensitive data in a cache that many users share, and says that such data should always come from the primary source.
What Is a Time to Live?
A TTL, or time to live, is the length of time a cached copy stays valid. When the time runs out, the copy is removed, and the next request loads fresh data from the origin. TTL is the main control a team uses to balance speed against freshness.
A short TTL keeps data fresher, but it causes more misses and more traffic to the origin. A long TTL raises the hit ratio and cuts load, but it lets stale data stay visible for longer.
Tip
Start with one question: how old can this answer be before a user notices a problem or is harmed by it? Let the answer set the TTL. Then measure the hit ratio and the freshness complaints, and adjust.
Accept Stale Data on Purpose
Speed has a price. A cached copy can be out of date until its TTL ends or until someone removes it. The old value may stay in the cache until the next read forces a refresh. That gap is the trade-off: users get faster answers, and in exchange they may see slightly old data.
Invalidation closes part of that gap. When the source changes, the app removes or updates the matching cache entry, so readers do not wait for the TTL to run out. Many teams combine a TTL with invalidation. Using only a TTL is simpler, but it accepts more staleness.
Caching can also create its own problems. A very long TTL on changing data shows old prices or old stock counts. A cache with no expiry and no eviction can grow without limit or keep serving wrong values. And if a cache fails and every request suddenly reaches the database, the database can be swamped. Microsoft's guidance suggests a circuit breaker to stop that flood.
Tip
Add caching only after measurement shows a real problem. Then check the hit ratio and the stale-data complaints after the change, so you know the cache is helping more than it hurts.
Quick check
A product page shows a store's category list. The list changes about once a month, but every page view queries the database for it. Traffic doubles and the database slows down. What is the problem, and what would you change first?
Worked Example: A News Home Page
A news site's home page runs the same database query for the top 10 headlines on every visit. Thousands of readers each minute trigger identical queries, and the database returns the same rows again and again. Here is how the team fixes it, one step at a time.
- 1
Spot the repeat
Monitoring shows that almost every visitor triggers the same top-10 headline query.
- 2
Check the data
Headlines change far less often than readers load the page, so the data is read-heavy and slow-changing.
- 3
Pick a TTL
Store the headline list for 60 seconds. Readers may see a headline that is at most one minute old, and the newsroom accepts that.
- 4
Serve from the cache
The first visit in each minute loads from the database. The visits after it read the stored copy until the TTL runs out.
- 5
Measure the result
Watch the hit ratio rise and the database query count fall. If readers complain about old headlines, shorten the TTL.
The code below models this idea with a fake database. To keep it short, it simulates one visit per second for 10 minutes, not thousands per minute. It counts how many times the database runs and how many visits the cache answers.
# Simulate one home page visit per second for 600 seconds.
db_queries = 0
cache = {}
hits = 0
misses = 0
TTL = 60
def load_headlines():
global db_queries
db_queries += 1
return ["Headline A", "Headline B", "Headline C"]
def get_home_page(now):
global hits, misses
entry = cache.get("home")
if entry is not None and now - entry[1] < TTL:
hits += 1
return entry[0]
misses += 1
headlines = load_headlines()
cache["home"] = (headlines, now)
return headlines
for second in range(600):
get_home_page(second)
total = hits + misses
print("requests:", total)
print("database queries:", db_queries)
print("hit ratio:", round(hits / total, 2))
Output
requests: 600 database queries: 10 hit ratio: 0.98
Without the cache, the database would run 600 times for 600 visits. With a 60-second TTL, it runs only 10 times. The rounded hit ratio is 0.98, which means about 98 out of every 100 visits never reach the database. Readers still see headlines that are at most a minute old, which is the trade-off the team chose.
Quick check
A finance app caches live stock prices with a 10-minute TTL to cut database load. Users say the prices look wrong. Which change fits best?
Common Mistakes to Avoid
Caching without measuring
Add a cache only after monitoring shows repeated reads. Check the hit ratio afterward to confirm it helps.
Caching data that must be exact
Account balances and stock counts need fresh reads or careful invalidation. A simple TTL may not be enough.
Forgetting the cache can fail
If the cache is down, the app should fall back to the source. Limit how many requests reach the source at once, so it is not flooded.
Key Takeaways
No Caching means the system keeps paying the full cost of the same answer. Look for repeated identical reads, heavy load on the data source, and slow answers for data that rarely changes. Measure the hit ratio and the query counts before and after any change. Cache the read-heavy, slow-changing data, give each copy a TTL, and decide on purpose how much staleness users can accept. Other lessons cover the specific caching strategies and where caches live, so you can go deeper there.
Sources
- No-Caching antipattern, Azure Architecture Center (Microsoft Learn)
- Performance testing and antipatterns, Azure Architecture Center (Microsoft Learn)
- Cache-Aside pattern, Azure Architecture Center (Microsoft Learn)
- No Caching antipattern in multitenant compute guidance, Azure Architecture Center on GitHub
- What is Caching? System design guide, AlgoMaster
- Caching Strategies Explained: From Browser to Database, and the Stale Data in Between, DEV Community
- 50 Caching Concepts Every Software Engineer Should Know, DesignGurus
- Understanding caching: a beginner's guide, Jakub Slys
Last updated on 18 November 2026
Related lessons
Learn with me
Every lesson is free. I add new ones as I learn. Have a question, or want help with your own work? Book a short call.