Scaling Reads easy
Your cache is full. You need to save a new item. Why do you need an 'Eviction Policy' (like LRU)?
- A To encrypt the new data.
- B To decide which database to call.
- C To decide which old item to delete to make room for the new one.
- D To compress the cache.
Answer: C. To decide which old item to delete to make room for the new one.
RAM is finite. When it fills up, you can't just stop accepting data. You must remove less useful data (Evict) to store new, potentially more useful data.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a caching system, what is a 'Cache Miss'?
- Why is `SELECT * FROM Users` generally discouraged in high-performance applications compared to `SELECT name, email FROM Users`?
- You have users all over the world downloading large images from your server in New York. Users in Australia complain it is slow. What solves this?
- What is the main downside of reading from a Read Replica instead of the Primary database?
- You have maximized the RAM on your single database server, but it's still too slow. You decide to add 10 more servers to share the load. What is this called?
- You have 5 Read Replicas. How does the application know which one to ask for data?