๐๐ฝ๐ฝ๐ฒ๐ฎ๐ฟ๐ถ๐ป๐ด ๐ณ๐ผ๐ฟ ๐ฎ ๐๐๐๐๐ฒ๐บ ๐ฑ๐ฒ๐๐ถ๐ด๐ป ๐ถ๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐ ?
Read this 8 system design non-functional requirements.
Non-Functional requirements defines qualities of a system, how a system is supposed to be.
For example: scalable, highly available, fast etc
๐ญ. ๐๐๐ฎ๐ถ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐
Availability = system uptime, the percentage of time system has been up
99% availability = the system was unavailable about 3.65 days a year.
Availability is measured as the success rate of requests.
99% availability = 99/100 = 1 req of 100 fails.
๐ญ.๐ฎ ๐๐ฎ๐๐น๐ ๐๐ผ๐น๐ฒ๐ฟ๐ฎ๐ป๐ฐ๐ฒ
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.
๐ฎ. ๐ฆ๐ฐ๐ฎ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐
Scalability is the ability of the system to handle growing load.
You can scale a system horizontally or vertically.
Ideally, horizontal and vertical scaling can be used in conjunction, eg, scale horizontally, then vertically, then again horizontally.
๐ฎ.๐ฎ ๐๐น๐ฎ๐๐๐ถ๐ฐ๐ถ๐๐
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 โค๏ธ
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
