The main goal of this chapter is to design a distributed cache. To achieve this goal, we should have substantial background knowledge, mainly on different reading and writing techniques. This lesson will help us build that background knowledge. Let’s look at the structure of this lesson in the table …
read moreSystem Design: Lesson 11.3 - High-Level Design of a Distributed Cache
In this lesson, we’ll learn to design a distributed cache. We’ll also discuss the trade-offs and design choices that can occur while we progress in our journey towards developing a solution.
Requirements
Let us start by understanding the requirements of our solution.
Functional
The following are the functional …
read moreSystem Design: Lesson 11.4 - Detailed Design of a Distributed Cache
This lesson will identify some shortcomings of the high-level design of a distributed cache and improve the design to cover the gaps. Let’s get started.
Find and remove limitations
Before we get to the detailed design, we need to understand and overcome some challenges:
- There’s no way for …
System Design: Lesson 11.5 - Evaluation of a Distributed Cache's Design
Requirements compliance
Let’s evaluate our proposed design according to the design requirements.
High performance
Here are some design choices we made that will contribute to overall good performance:
- We used consistent hashing. Finding a key under this algorithm requires a time complexity of O(log(N)), where N represents …
System Design: Lesson 11.6 - Memcached versus Redis
Introduction
This lesson will discuss some of the widely adopted real-world implementations of a distributed cache. Our focus will be on two well-known open-source frameworks: Memcached and Redis. They’re highly scalable, highly performant, and robust caching tools. Both of these techniques follow the client-server model and achieve a latency …
read moreSystem Design: Lesson 10.1 - Focus on Client-Side Errors in a Monitoring System
Client-side errors
In a distributed system, clients often access the service via an HTTP request. We can monitor our web and application servers’ logs if a request fails to process. If multiple requests fail, we can observe a spike in internal errors (error 500).
Those errors whose root cause is …
read moreSystem Design: Lesson 10.2 - Design of a Client-Side Monitoring System
A service has no visibility of the errors that don’t occur at its infrastructure. Still, such failures are equally frustrating for the customers, and they might have to ask their friends, “Is the service X down for you as well?” or head to sites like Downdetector to see if …
read moreSystem Design: Lesson 8.1 - Distributed Monitoring
Monitoring
The modern economy depends on the continual operation of IT infrastructure. Such infrastructure contains hardware, distributed services, and network resources. These components are interlinked in such infrastructure, making it challenging to keep everything functioning smoothly and without application downtime.
It’s challenging to know what’s happening at the …
read moreSystem Design: Lesson 8.2 - Introduction to Distributed Monitoring
Need for monitoring
Let’s go over how the failure of a single service can affect the smooth execution of related systems. To avoid cascading failures, monitoring can play a vital role with early warnings or steering us to the root cause of faults.
Let’s consider a scenario where …
read moreSystem Design: Lesson 8.3 - Prerequisites of a Monitoring System
Monitoring: metrics and alerting
A good monitoring system needs to clearly define what to measure and in what units (metrics). The monitoring system also needs to define threshold values of all metrics and the ability to inform appropriate stakeholders (alerts) when values are out of acceptable ranges. Knowing the state …
read more