Most applications built by startups in Ethiopia are what we call single-server applications. That means the application, database, cache, and other components all run on the same server.
This approach is simple and cost-effective in the beginning, but it doesn't scale well as traffic and complexity grow.
That's one of the reasons the industry shifted toward distributed systems.
However, moving to distributed systems comes with trade-offs. One of the most important concepts to understand is the CAP Theorem.
CAP stands for:
- C β Consistency
- A β Availability
- P β Partition Tolerance
The CAP Theorem states that during a network partition (a communication failure between nodes), a distributed system can guarantee at most two of these three properties.
By choosing a distributed architecture, you've already committed to Partition Tolerance (P). That means, during a partition, you must choose between Consistency (C) and Availability (A).
Consistency (C)
Every read returns the most recent write (or an error if it can't).
Availability (A)
Every request receives a response, even if some nodes are unavailable. The response may not always contain the latest data.
Partition Tolerance (P)
The system continues operating even when communication between nodes is interrupted.
The trade-off
There is no universally "correct" choiceβit depends on your application's requirements.
π³ Banking, payment, and booking systems usually prioritize Consistency, because serving stale data can have serious consequences.
π± Social media, blogs, and content platforms often prioritize Availability, because users generally prefer getting a response immediately, even if the data is slightly outdated.
Understanding these trade-offs is one of the first steps toward designing reliable distributed systems.
#DistributedSystems #SystemDesign #CAPTheorem #Backend #SoftwareEngineering #CloudComputing
This approach is simple and cost-effective in the beginning, but it doesn't scale well as traffic and complexity grow.
That's one of the reasons the industry shifted toward distributed systems.
However, moving to distributed systems comes with trade-offs. One of the most important concepts to understand is the CAP Theorem.
CAP stands for:
- C β Consistency
- A β Availability
- P β Partition Tolerance
The CAP Theorem states that during a network partition (a communication failure between nodes), a distributed system can guarantee at most two of these three properties.
By choosing a distributed architecture, you've already committed to Partition Tolerance (P). That means, during a partition, you must choose between Consistency (C) and Availability (A).
Consistency (C)
Every read returns the most recent write (or an error if it can't).
Availability (A)
Every request receives a response, even if some nodes are unavailable. The response may not always contain the latest data.
Partition Tolerance (P)
The system continues operating even when communication between nodes is interrupted.
The trade-off
There is no universally "correct" choiceβit depends on your application's requirements.
π³ Banking, payment, and booking systems usually prioritize Consistency, because serving stale data can have serious consequences.
π± Social media, blogs, and content platforms often prioritize Availability, because users generally prefer getting a response immediately, even if the data is slightly outdated.
Understanding these trade-offs is one of the first steps toward designing reliable distributed systems.
#DistributedSystems #SystemDesign #CAPTheorem #Backend #SoftwareEngineering #CloudComputing
Happy Sunday, everyone! βοΈ
Just got home. Time to grab a coffee and do a shit ton of LeetCode.
Let's see how many problems I can knock out today. πͺ
Just got home. Time to grab a coffee and do a shit ton of LeetCode.
Let's see how many problems I can knock out today. πͺ
Forwarded from αα
ααα¬ π€πΌ
Sometimes:α¨α°α΅α³α½α αα αα₯ α°ααα½αα αα΅αα°α αααα₯ααα’
β€2
Forwarded from Programmer Humor