internalsGet Pro

System Design · Module 07

Caching and CDNs

Lessons
12
Free
1
Reading
~4 h

Your progress

0 / 12 lessons done

Sign in to track

Lessons

  1. Cache placement: from browser to databaseFreeA cache can remove a database query without removing the slow network trip. Placement determines whose waiting time improves, which systems receive less traffic, and who might see a cached response.15 min
  2. Caching patterns: cache-aside, write-through and write-backAdding a cache changes more than read speed. You must decide who keeps it current and whether acknowledged changes survive losing it.18 min
  3. Eviction policies: LRU, LFU and moreA full cache must discard something. The policy determines whether that space serves returning customers or fills with data nobody reads again.18 min
  4. TTLs: expiring cached dataExpiration settings affect what customers see and how much work reaches your database. You need to understand both before changing a TTL in production.18 min
  5. Cache invalidation: keeping cached data correctA successful database update can leave customers reading old data. You need to decide which copies become invalid, how to remove them, and what happens when that removal fails.19 min
  6. Distributed caching: sharing a cache across serversAdding application servers can duplicate cached data and database work. A shared cache changes that behavior, but introduces network calls, routing decisions and a shared failure dependency.18 min
  7. Cache stampede: many requests hitting the database at onceA cache can remove most database reads and still expose the database to a sudden burst when an entry disappears. You need to control who rebuilds the entry, not only how long it stays cached.19 min
  8. Hot keys: handling one extremely popular itemA cache can have spare memory and a high hit rate yet still delay requests. One popular item can overload its owner while other cache nodes sit mostly idle.19 min
  9. Cache race conditions: concurrent reads and writesA successful cache deletion does not stop an older request from putting stale data back. You meet this problem whenever several application instances read and update the same cached records.19 min
  10. Cache failures and database fallbackA cache outage can overload a healthy database. You need a fallback policy that preserves useful service without sending every failed cache read downstream.19 min
  11. CDNs: caching content close to usersProduct images and application files often travel farther than the database queries behind a page. A CDN shortens that journey, but its shared copies introduce correctness, security and deployment decisions.18 min
  12. Design: a fast product catalog pageA popular product page must stay useful during traffic spikes without exposing another customer’s data or treating cached stock as a purchase guarantee. This design connects cache performance to those correctness boundaries.30 min

Practise with

Terms this module teaches 34

Open glossary

Admission control

Deciding whether work may start before it consumes a limited resource.