If a system is fault tolerant, then it is also highly available.
A fault tolerant system aims 0 downtime.
A fault tolerant system is designed to continue to operate even if one of its connecting components fails.
eg. An airplane is a fault tolerant system, even if one engine fails, the other engine resumes immediately, and the system continues to operate.
๐ญ.๐ฏ ๐ฅ๐ฒ๐๐ถ๐น๐ถ๐ฒ๐ป๐ฐ๐ฒ
A resilience system is almost the same as a fault tolerant system, one extra thing is,
a resilient system is designed to be periodically tested for fault tolerance.
A resilient system has a practice of periodically testing the system for faults by deliberately generating faults. Done using caos engineering, game day engineering etc
You may have a highly available system, but it might still suffer with frequent data corruption, and returns incorrect results.
Or the system is too slow and response is no longer useful.
Although we have availability, we donโt have reliability.
Fault tolerant, resilience, and reliability relate to the same concept, availability.
When your interviewer asks you to design a fault-tolerant or resilient or reliable system, apply the same set of principles and best practices that is used for availability.
Elasticity is similar to scalability but it's for short term, tactical needs.
If our system is elastic, we can start with N machines at the start of the day, and keep adding machines throughout the day as the load increases. After the peak load has passed, we gradually decrease the number of machines.
A highly performance system is quick with its request and response processing.
If your interviewer asked you to design a performant system, think in terms of latency and throughput.
๐ฐ. ๐๐๐ฟ๐ฎ๐ฏ๐ถ๐น๐ถ๐๐
In a durable system, once data is successfully submitted, it can not be lost.
You can achieve durability using
- Backup
- Raid
- Replication
๐ฑ. ๐๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐ฐ๐
Consistency guarantees that your data is consistent across all distributed copies.
In a large distributed system consistency is hard to achieve.
Cap theorem tells that in case of a network partition, you can choose either consistent or availability.
๐ฒ. ๐ ๐ฎ๐ถ๐ป๐๐ฎ๐ถ๐ป๐ฎ๐ฏ๐ถ๐น๐ถ๐๐
Maintainability is the ability of the system to go through repairs/modifications while it is up and running.
Once a fault is detected, it is desirable to be able to apply the necessary improvements asap, without having to shut down the system.
๐ณ. ๐ฆ๐ฒ๐ฐ๐๐ฟ๐ถ๐๐
Security assures that all data within the system or its part is protected against any malware attacks/unauthorized access.
Security system include three fundamentals attributes, often referred to as the CIA triad
- Confidentiality
- Integrity
- availability
8. Cost
Cost non-functional requirement can be classified into - Development cost
- Maintenance cost
- Resource cost
Closing this thread now.
These are important system design concepts, and each non-functional requirement deserves a detailed post of its own.
More on that later.
Retweet and follow @happydecoder โค๏ธ
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh
Chances are high that your service experiences a sudden burst in traffic.
This can degrade your system performance, and potentially lead to service outage.
How do you tackle this ?
๐งต
๐๐ฃ๐ ๐ฟ๐ฎ๐๐ฒ ๐น๐ถ๐บ๐ถ๐๐ถ๐ป๐ด lets you limit the number of requests that a client can send to the server within a certain time interval.
Once the upper limit is reached,
Further requests are either queued for later processing, or straight up dropper and ignored.
Let's understand the core reasoning behind having a rate limiter in place.
Requests on the server consume resources, e.g CPU, memory, disk etc.
If your server is bombarded with more requests than it is designed to handle.
First, it's important to understand two key concepts.
- ๐๐๐๐ต๐ผ๐ฟ๐ถ๐๐ฎ๐๐ถ๐ผ๐ป
- ๐๐๐๐ต๐ฒ๐ป๐๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป
They are similar but not the same.
Let's see how ?
Say you're a developer in a tech company.
Your company ID card is your ๐๐จ๐ง๐๐๐ก๐ง๐๐๐๐ง๐๐ข๐ก - it's your identity.
As a developer you're authorized to code push and deploy.
But you're not authorized to access mergers and acquisition data.
In a distributed world the micro services need to be able to talk to each other.
For instance,
When you hit the โค๏ธ button, the reaction service(service A) talks to the notification service(service B), and I'm notified of your reaction.
How does micro services communicateโ
There are two ways a service instance A can communicate with another service instance B.
1. Synchronous 2. Asynchronous
Synchronous -
In synchronous messaging the client sends its request directly to the server, and waits for the response to arrive.
The Client is dependent on the response from the server to proceed with its other requests.