Files
system-design-101/data/guides/things-to-consider-when-using-cache.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

1.3 KiB

title, description, image, createdAt, draft, categories, tags
title description image createdAt draft categories tags
Things to Consider When Using Cache Top 5 things to consider when using cache to build fast online systems. https://assets.bytebytego.com/diagrams/0362-things-to-consider-when-using-cache.png 2024-02-23 false
caching-performance
Caching
Performance

Caching is one of the 𝐦𝐨𝐬𝐭 𝐜𝐨𝐦𝐦𝐨𝐧𝐥𝐲 used techniques when building fast online systems. When using a cache, here are the top 5 things to consider:

The first version of the cheatsheet was written by guest author Love Sharma.

Suitable Scenarios

  • In-memory solution

  • Read heavy system

  • Data is not frequently updated

Caching Techniques

  • Cache aside

  • Write-through

  • Read-through

  • Write-around

  • Write-back

Cache Eviction Algorithms

  • Least Recently Used (LRU)

  • Least Frequently Used (LFU)

  • First-in First-out (FIFO)

  • Random Replacement (RR)

Key Metrics

  • Cache Hit Ratio

  • Latency

  • Throughput

  • Invalidation Rate

  • Memory Usage

  • CPU usage

  • Network usage

Other Issues

  • Thunder herd on cold start

  • Time-to-live (TTL)