Architecture in Distributed Systems
A. F. M. Minhazur Rahman
Assistant Professor
Deparment of CSE
Rajshahi University of Engineering & Technology
9/11/24 Architecture in Distributed Systems 1
Introduction
• Distributed systems are often complex pieces of software
• To master their complexity, it is crucial that these systems are
properly organized.
• Software architecture refers to the logical organization of a
distributed system into software components.
• Components are modular units that can be replaced while the system
operates, enabling continuous functionality even during maintenance.
• Architectural style is defined by components, their connections,
data exchange, and the overall system configuration.
9/11/24 Architecture in Distributed Systems 2
Connectors and Architectural Styles
• Connectors mediate communication, coordination, or
cooperation between components.
• Connectors support procedure calls, message passing, or data
streaming, ensuring flow of control and data.
• Configurations of components and connectors lead to various
architectural styles.
• Layered architectures
• Object-based architectures
• Resource-centered architectures
• Event-based architectures
9/11/24 Architecture in Distributed Systems 3
Layered Architectural Style
• Layered style involves organizing components in a hierarchical
fashion.
• A component at layer Lj can make a downcall to a lower-level
component at layer Li (i < j), typically expecting a response.
• Upcalls to higher-level components are less common and made
only in exceptional cases.
9/11/24 Architecture in Distributed Systems 4
Layered Architectural Style
9/11/24 Architecture in Distributed Systems 5
Layered Architectural Protocol Stack
9/11/24 Architecture in Distributed Systems 6
Object-Based Architectural Style
• Object-based architectures are organized more
loosely than layered architectures.
• Each object acts as a component, and these
components are connected through a procedure
call mechanism.
• Object-based architectures encapsulate data
(object's state) and operations on that data
(object's methods) into a single entity.
• The interface of an object hides implementation
details, making an object essentially independent
of its environment.
• Similar to components in a layered architecture,
objects with well-defined interfaces can be
replaced by another object with the same interface
without disturbing the system.
9/11/24 Architecture in Distributed Systems 7
Resource-based Architectural Style
• Resource-centered architectures view distributed systems as a
collection of individually managed resources.
• Resources may be added or removed by (remote) applications,
and likewise can be retrieved or modified
• This approach, known as Representational State Transfer
(REST), is widely adopted for the Web.
• Key characteristics of RESTful architectures include:
• Identification of resources through a single naming scheme.
• All services offer the same interface with at most four operations.
• Messages sent to or from a service are fully self-described.
• After executing an operation at a service, the component forgets
everything about the caller.
9/11/24 Architecture in Distributed Systems 8
Resource-based Architectural Style
• Example: Amazon’s Simple Storage Service (Amazon S3), where
resources are objects (equivalent of files) and buckets (equivalent of
directories) which can be accessed or modified using HTTP requests.
• http://BucketName.s3.amazonaws.com/ObjectName
9/11/24 Architecture in Distributed Systems 9
Publish-Subscribe Architectures Overview
• Publish-subscribe architectures are designed to minimize
dependencies in growing systems, separating processing
and coordination.
• In this model, coordination encompasses the communication
and cooperation between processes.
9/11/24 Architecture in Distributed Systems 10
Publish-Subscribe Architectures
• Event-based coordination involves referentially decoupled
and temporally coupled systems
• Processes publish notifications about events, and other processes
subscribe to these notifications.
• Shared data space coordination is both referentially and
temporally decoupled
• Processes communicating via structured data records (tuples) in a
shared space.
• Processes insert and retrieve tuples using associative search
mechanisms.
• Can be combined with event-based coordination: processes subscribe
to tuples and are notified when matching tuples are inserted.
9/11/24 Architecture in Distributed Systems 11
Publish-Subscribe Architectures
9/11/24 Architecture in Distributed Systems 12
System Architecture
• The actual realization of a distributed system requires that we
instantiate and place software components on real machines.
• Many different choices that can be made in doing so.
• The final instantiation of a software architecture is also referred
to as a system architecture.
9/11/24 Architecture in Distributed Systems 13
Centralized Architecture
• In the basic client-server model, processes
in a distributed system are divided into two
groups.
• Server is a process implementing a
specific service.
• Example, a file system service or a
database service.
• Client is a process that requests a service
from a server by sending it a request and
subsequently waiting for the server's reply.
• This interaction is knows as request-reply
behaviour
9/11/24 Architecture in Distributed Systems 14
Application Layering
• Application layering divides distributed applications into three
logical levels.
• Follows a layered architectural style.
• Each part of an application serves a distinct purpose:
• Application-interface level: Handles interaction with users or external
applications
• Processing level: Contains the core functionality of the application
• Data level: Operates on a database or file system
9/11/24 Architecture in Distributed Systems 15
Application Layering
• An Internet search engine layered
approach.
• Application-interface level: The user
types in keywords and receives a list of
relevant web pages.
• Processing level: Transforms user
keywords into database queries, ranks the
results, and generates the output in HTML
format.
• Data level: A large database of prefetched
and indexed web pages.
• This organization ensures a separation of
concerns, making the application easier to
manage and scale
9/11/24 Architecture in Distributed Systems 16
Multitiered Architectures
• Distinction into three logical levels suggests various possibilities
for distributing a client-server application across multiple
machines
• The simplest organization involves only two types of machines:
• Client machines: Implementing (part of) the user-interface level
• Server machines: Implementing the processing and data levels
• This organization allows the server to handle all processing
while the client acts as a terminal with a user interface.
• There are, however, many other possibilities
9/11/24 Architecture in Distributed Systems 17
Two-tiered Architecture
9/11/24 Architecture in Distributed Systems 18
Three-tiered Architectures
• Three-tiered architecture recognizes that a
server may sometimes need to act as a
client, leading to a more complex
distribution of tasks.
• Example of a three-tiered architecture is
found in the organization of websites.
• The Web server acts as an entry point to a
site, forwarding requests to an application
server where the actual processing takes
place.
• This application server then interacts with
a database server.
9/11/24 Architecture in Distributed Systems 19
Types of Distribution
• Vertical Distribution: Logically different components are
placed on different machines.
• Horizontal Distribution:
• Client/Server physically split into logically equivalent parts
• Each part operates on own share of complete dataset
• Ensures better load balancing
9/11/24 Architecture in Distributed Systems 20
Decentralized Architectures
• Decentralized architecture refers to a system or network design
where decision-making, control, and data distribution are
distributed among multiple nodes.
• Not concentrated in a central authority or location.
• Peer-to-peer is a system architecture that supports horizontal
distribution.
• The processes that constitute a peer-to-peer system are all equal.
• How to organize process in a overlay network?
• Structured peer-to-peer systems
• Unstructured peer-to-peer systems
• Hierarchically organized peer-to-peer networks
9/11/24 Architecture in Distributed Systems 21
BitTorrent: A Peer-to-Peer System
• BitTorrent is a peer-to-peer file sharing
system
• Design goal was to ensure collaboration
• In BitTorrent, a file can be downloaded
only when the downloading client is
providing content to someone else
• Prevents free riding
9/11/24 Architecture in Distributed Systems 22
BitTorrent: A Peer-to-Peer System
• A torrent file contains the information that is needed to download a
specific file
• Tracker is a server that keeps track of active nodes that have
(chunks of) the requested file.
• When a peer A has found the tracker for a file F, the tracker returns a
subset of all the nodes currently involved in downloading F.
• The complete set of downloading nodes for a specific file F is known
as a swarm.
• A peer refers to an individual user or node within the swarm.
• A node that has all chunks of F and continues to participate in its
swarm is known as a seeder.
• All others in the swarm are known as leechers.
9/11/24 Architecture in Distributed Systems 23
References
[1] A. S. Tanenbaum and M. van Steen, Distributed Systems:
Principles and Paradigms, 2nd edition. CreateSpace Independent
Publishing Platform, 2016.
[2] M. van Steen and A. S. Tanenbaum, Distributed Systems, 3rd
edition. CreateSpace Independent Publishing Platform, 2017.
9/11/24 Architecture in Distributed Systems 24
Thank You
9/11/24 Architecture in Distributed Systems 25