Question 9 of 11 · PYQ 2025 · 12 marks
Open in ChatGPTBriefly explain the Architectures of Distributed Systems. List out pros and cons of distributed systems.
Introduction
A distributed system's architecture describes how its components are arranged and how they interact. Several styles recur, and each is a trade of coupling against scale.
Architectures
- Layered. Each layer uses only the one below: presentation, application, data. Easy to reason about; a request crosses every layer.
- Client-server. Clients request, servers provide. Simple, centralised authority, but the server is a bottleneck.
- N-tier. The client-server idea with the application and data tiers separated, each independently replicable.
- Object-based. Components are objects called remotely through a broker (CORBA, RMI). Location-transparent, at the cost of a broker.
- Data-centred (repository). Components share one store and communicate through it. Strong consistency for free; the store is a single point of contention.
- Event-based (publish-subscribe). Publishers emit events, subscribers react. Loose coupling and easy fan-out; no one knows the end-to-end flow.
- Peer-to-peer. Every node is both client and server. Scales with the participants; hard to guarantee anything.
- Microservices. The object-based style at process granularity: small services, independent deployment, network calls between them.
- Hybrid. Client-server in front, peer-to-peer behind (BitTorrent tracker plus peers), or a layered API over an event bus.
Diagram
Pros of distributed systems
- Scalability: capacity grows by adding nodes.
- Fault tolerance: a failed node is replaced by a replica.
- Resource sharing: storage, printers, compute shared across users.
- Locality: computation and data can sit near the user.
- Incremental growth: a small cluster today, a large one tomorrow.
Cons
- Complexity: partial failure, no global clock, no shared memory; every call can fail.
- Consistency cost: keeping replicas aligned needs coordination, which costs latency.
- Security surface: every node and every link is an attack surface.
- Operational overhead: deployment, monitoring and debugging span many machines.
- Latency: a network hop is orders of magnitude slower than a memory read.
- Debugging: a request crosses several services, so observability (traces, correlation ids) becomes mandatory.
Conclusion
The architectures differ in where they put the coupling: layers in the code, a broker between objects, a store between components, events between services. Every one of them buys scale and pays for it in partial failure, which is the defining cost of a distributed system.