AdvancedTopic 83 of 104Software & Computing
Caching and load balancing
Improve performance and scale by distributing and reusing work.
In depth
Caches (browser, CDN, Redis) store frequent results close to users, with policies (LRU, TTL) and invalidation challenges. Load balancers (round robin, least connections, consistent hashing) spread traffic across servers, with health checks. Together they cut latency and raise availability.
Key points
- Cache hit ratio
- Layer 4 vs layer 7
- Sticky sessions
ExampleA CDN serves static images from servers near the user.
What is Caching and load balancing?
Improve performance and scale by distributing and reusing work.
Why is it important to understand caching and load balancing?
Caching and load balancing improve performance and let a system scale by reusing results and spreading requests across servers.
What is cache invalidation?
Removing or updating cached items when the underlying data changes, which is one of the hardest problems in caching.
What does a load balancer do?
It distributes incoming requests across servers and can remove unhealthy servers from rotation.
How is Caching and load balancing used in practice?
Typical applications include storing the results of a costly database query for a few minutes, spreading incoming web requests across three application servers and serving static images from a content delivery network close to users.
What should I learn before Caching and load balancing?
Study "Consensus algorithms" first (topic 82 of 104 in Software & Computing). It covers the groundwork this topic builds on.
What are the key points of Caching and load balancing?
Cache hit ratio. Layer 4 vs layer 7. Sticky sessions.
Can you give an example of Caching and load balancing?
A CDN serves static images from servers near the user.
What comes after Caching and load balancing?
The next topic is "Message queues and streaming", which builds directly on this one.
How difficult is Caching and load balancing?
It is classed as Advanced in Software & Computing (topic 83 of 104). It is an advanced topic. It assumes you are comfortable with the intermediate topics in Software & Computing.