
Durgesh Tiwari
Author
Modern applications such as Google Search, Amazon, Netflix, WhatsApp, and Instagram serve millions of users around the world every day. A single server is often not enough to handle such massive traffic, process large amounts of data, or provide high availability.
To solve these challenges, developers use distributed systems, where multiple computers work together to run a single application.
A distributed system is a collection of independent computers or servers that work together to perform a common task. Although the system runs on multiple machines, it appears to users as a single application.
These machines communicate over a network to share data, process requests, and coordinate tasks.
In simple words, a distributed system is a group of computers that work together to provide a single service or application.
Distributed systems are widely used in cloud computing, social media, online banking, e-commerce, streaming services, and enterprise applications.

As applications grow, a single server can no longer handle increasing traffic and workloads efficiently. Distributed systems solve this problem by distributing requests across multiple machines.
Some key benefits include:
Handle millions of users efficiently.
Improve application performance.
Increase reliability.
Provide high availability.
Scale as demand grows.
Reduce the impact of hardware failures.
Many popular applications rely on distributed systems to deliver fast and reliable services.
Some examples include:
Netflix streams videos using servers distributed across multiple regions.
Amazon distributes customer requests across many servers to support millions of shoppers.
Google Search processes search queries using thousands of distributed machines.
WhatsApp routes messages through multiple servers for fast and reliable delivery.
Google Drive and Dropbox store files across multiple servers to improve availability and reliability.
Distributed systems have several characteristics that make them suitable for building scalable, reliable, and highly available applications.
Scalability: The ability to handle increasing workloads by adding more servers instead of upgrading a single machine.
Example: During a festival sale, an e-commerce website adds more servers to handle increased traffic.
Fault Tolerance: The ability to continue operating even when one or more servers fail.
Example: If one video streaming server fails, another server continues serving users without interruption.
High Availability: Ensures the application remains accessible with minimal downtime by using multiple server instances.
Example: If one banking server goes offline, another server automatically handles user requests.
Reliability: Ensures the system consistently provides correct results, even during failures, using techniques such as data replication and backups.
Example: A cloud storage service stores multiple copies of files so data remains available even if one server fails.
Transparency: Hides the complexity of the underlying distributed system, making multiple servers appear as a single application to users.
Example: A Google search may be processed by multiple servers, but users experience it as a single search service.
Concurrency: Allows multiple users or processes to access the system simultaneously without interfering with each other.
Example: Thousands of customers can place orders at the same time on an e-commerce website.

Although distributed systems provide scalability, reliability, and high availability, they are more complex to build and manage than traditional systems. Developers must handle challenges such as network failures, latency, partial failures, data consistency, clock synchronization, and distributed transactions.
Servers communicate over a network, so communication may fail if the network is slow or unavailable.
Example: If the Order Service cannot reach the Payment Service, the payment request may fail.
Latency is the time taken for data to travel between systems. High latency increases response time.
Example: A user in India accesses data stored in another country, resulting in a slower response.
A partial failure occurs when one service fails while the rest of the system continues running.
Example: If the Notification Service fails, users should still be able to place orders and complete payments.
Data Consistency ensures that all copies of data remain synchronized across multiple servers.
Example: If a customer's address is updated on one server but not another, different users may see different information.
Different servers have their own clocks. Synchronizing them ensures events are recorded in the correct order.
Example: In a banking system, synchronized clocks ensure transactions are recorded correctly.
A distributed transaction is a single operation that involves multiple services or databases. If one step fails, the system must recover to maintain consistency.
Example: During order placement, if payment succeeds but the inventory update fails, the system must recover to avoid inconsistent data.
The CAP Theorem is one of the most important concepts in distributed systems.
It states that during a network partition, a distributed system can guarantee only two of the following three properties:
Consistency (C)
Availability (A)
Partition Tolerance (P)
In simple words, when a network partition occurs, a distributed system must choose between Consistency and Availability because it cannot guarantee both at the same time.
Consistency ensures that every user sees the most recent version of the data after an update.
Example: After a bank transfer is completed, every ATM, mobile app, and banking website immediately shows the updated account balance.
Availability ensures that the system always responds to user requests, even if some servers fail.
The response may not always contain the latest data.
Example: A social media platform continues serving users even if some recently updated posts are temporarily unavailable.
Partition Tolerance is the ability of a distributed system to continue operating even when communication between servers is interrupted.
Example: If two data centers lose network connectivity, each continues serving its local users until communication is restored.
Suppose an online shopping application runs in two different regions.
A customer purchases the last available product while the network connection between the two regions fails.
The system now has two choices:
Choose Consistency: Wait until both regions synchronize before accepting new orders.
Choose Availability: Continue accepting orders even if some users temporarily see outdated inventory information.
Since a network partition already exists, the system cannot guarantee both consistency and availability simultaneously.

CP systems prioritize consistent data during network failures, even if some requests are delayed or rejected.
Examples:
Banking systems
Financial applications
Inventory management systems
AP systems prioritize availability, allowing users to continue accessing the application even if some data is temporarily outdated.
Examples:
Social media platforms
News websites
Streaming services
CA systems provide both Consistency and Availability only when there are no network partitions.
Since network failures are unavoidable in distributed systems, pure CA systems are generally limited to single-server or non-distributed applications.
The PACELC Theorem extends the CAP Theorem by explaining the trade-offs a distributed system makes both during a network partition and during normal operation.
While CAP focuses only on network failures, PACELC also considers the trade-off between Latency and Consistency when the network is functioning normally.
In simple words, PACELC states that a distributed system must balance Consistency, Availability, and Latency depending on the situation.
The PACELC Theorem extends the CAP Theorem by explaining the trade-offs a distributed system makes both during a network partition and during normal operation.
PACELC stands for:
P → Partition
A → Availability
C → Consistency
E → Else (when there is no partition)
L → Latency
C → Consistency
It can be summarized as:
If a network partition occurs (P), choose between Availability (A) and Consistency (C).
Else (E), choose between Latency (L) and Consistency (C).

When communication between servers is interrupted, the system must choose between:
Consistency
Availability
This is the same trade-off described by the CAP Theorem.
When there is no network partition, the system must choose between:
Lower Latency (faster responses)
Stronger Consistency (latest data)
Waiting for all servers to synchronize improves consistency but increases response time.
Responding immediately reduces latency but may temporarily return slightly outdated data.
Example
Suppose you're checking product availability on an online shopping website.
Waiting for all servers to synchronize ensures you always see the latest stock information, but the response is slower.
Responding immediately loads the page faster, but the stock information may be slightly outdated.
This is the Latency vs Consistency trade-off described by PACELC.
PACELC helps developers design distributed systems by considering trade-offs during both network failures and normal operation.
It helps developers:
Balance consistency, availability, and latency.
Design scalable distributed systems.
Improve application performance.
Choose the right architecture based on business requirements.
In distributed systems, data is often stored across multiple servers to improve scalability, reliability, and availability. After data is updated, it may take some time for every server to reflect the latest change.
A consistency model defines how and when updated data becomes visible to users across a distributed system.
Different applications require different consistency models depending on their business requirements. For example, a banking application requires stronger consistency than a social media platform.
In simple words, a consistency model defines how quickly users see updated data after it changes.
Choosing the right consistency model helps developers balance:
Data accuracy
Performance
Availability
Scalability
User experience
Causal Consistency ensures that related operations are observed in the correct order by every user.
Independent operations may appear in different orders, but related operations always maintain their logical sequence.
Related events always appear in the correct order.
Example
If a user publishes a post and then adds a comment, everyone sees the post before the comment.
Preserves the order of related events.
Improves user experience.
Useful for messaging and collaborative applications.
More complex than eventual consistency.
Requires tracking relationships between operations.
Read-Your-Writes Consistency guarantees that after a user updates data, they immediately see their own latest changes.
Other users may temporarily see older data until synchronization completes.
After you update something, you always see your latest changes.
Example
After changing your account password, you immediately see the updated information when opening your account settings.
Improves user experience.
Prevents confusion after updates.
Makes applications feel responsive.
Applies only to the user who made the update.
Other users may temporarily see older data.
Monotonic Reads ensure that once a user has seen a version of the data, they never see an older version later.
Every future read returns the same or a newer version.
Once you see new data, you never go back to seeing an older version.
Example
After a new email appears in your inbox, refreshing the inbox should never make that email disappear because of an older data version.
Prevents users from seeing older data.
Provides a more consistent user experience.
Reduces confusion.
Does not guarantee the latest data.
Requires tracking previously seen versions.
Feature | Strong Consistency | Eventual Consistency |
|---|---|---|
Data Visibility | Every user immediately sees the latest data | Users may temporarily see older data |
Data Accuracy | Always returns the latest data | Eventually returns the latest data |
Response Time | Usually slower | Usually faster |
Availability | Lower during network failures | Higher during network failures |
Scalability | Moderate | High |
Best For | Banking, financial systems, inventory management | Social media, cloud storage, content delivery |
Availability and Partition Tolerance are two fundamental properties of distributed systems described by the CAP Theorem. They define how a system behaves when servers fail or communication between servers is interrupted.
Availability ensures that every user request receives a response, even if some servers or components fail.
The response may not always contain the latest data, but the application remains accessible.
Availability means the system continues responding to requests even during failures.
Example
If one database server becomes unavailable, another server handles the request so users can continue using the application.
Keeps the application accessible
Reduces downtime
Improves user experience
May return outdated data
Requires additional infrastructure
May sacrifice consistency during failures
Prioritize availability when building:
Social media platforms
Streaming services
E-commerce applications
Systems where uptime is more important than always showing the latest data
Partition Tolerance is the ability of a distributed system to continue operating even when communication between servers is interrupted.
Instead of shutting down, each server continues processing requests until communication is restored.
Partition Tolerance means the system continues working even when servers cannot communicate with each other.
Example
If two data centers lose network connectivity, both continue serving local users independently until the connection is restored.
Keeps the system running during network failures
Improves reliability
Prevents complete outages
May require choosing between consistency and availability
Makes distributed systems more complex
Synchronizing data after recovery can be challenging
Partition Tolerance is essential for:
Distributed systems
Multi-region applications
Cloud-based applications
Systems that must survive network failures
Feature | Availability | Partition Tolerance |
|---|---|---|
Purpose | Keeps the application accessible | Keeps the system running during network failures |
Focus | Responding to requests | Handling network failures |
During Failure | Continues serving users | Continues operating despite partitions |
Example | Backup server handles requests | Multiple regions continue working independently |
Distributed systems help applications scale across multiple servers while improving reliability, availability, and fault tolerance. However, they also introduce challenges such as network failures, data consistency, and system complexity.
Basics of Distributed Systems and their importance.
Key characteristics like Scalability, Fault Tolerance, and High Availability.
Common challenges such as Network Failures, Latency, and Data Consistency.
CAP Theorem and its trade-off between Consistency, Availability, and Partition Tolerance.
PACELC Theorem and the balance between Latency and Consistency.
Different Consistency Models including Strong Consistency and Eventual Consistency.
Important distributed system trade-offs.
Understanding these concepts helps in designing scalable, reliable, and fault-tolerant applications.