System Design — Design TinyURL Follow-up : Caching
Discussing how caching can be used to improve read performance in system design using the TinyURL solution as an example. This is a follow-up article to System Design — Introduction and Design Tiny URL.
In the previous article, we discussed what System Design is, how to approach System Design tasks, and then designed a barebones TinyURL working solution. The very first follow-up question that you may ask is, how do we improve the system performance?
As discussed, the TinyURL system is a read-heavy system because the average read QPS is estimated to be 100 and the average write QPS is 10. If we can improve the read performance of the system, that would cover roughly 90% of the system load.
Cache — A Sweet “Candy” for Read-Heavy systems
For read-heavy systems, caching is a very efficient way to both improve read query performance and reduce database server load. A couple of take away notes about caching:
- When data can be retrieved from the cache service, the database server handles a lot less read requests and can “relax” a little bit
- Cache service, whether you use…