Chapter 2
Architecture Styles
in
Distributed Systems
Introduction
Distributed architecture refers to a model where software
components that reside on networked computers
communicate and coordinate their actions to achieve a
common goal.
Computation tasks are divided among several machines
rather than relying on a central server.
Workload division by distributed architectures enhances a
system's performance, scalability, and resilience.
Cont.…
A key advantage of distributed architecture is its fault
tolerance.
If one node in the system fails, others can take over its
tasks, ensuring uninterrupted service.
Moreover, this architecture can easily be scaled up by
adding more machines which makes it an excellent choice
for large, complex applications.
Key Components Of Distributed Architectures
Nodes
These are the individual computers or servers that
comprise the distributed system.
Network
This is the communication infrastructure that connects all
nodes.
Middleware
Middleware is an intermediate layer of software that sits
between the application and the network used to provide
common services.
Cont.…
Shared Data/Database
This is where the system stores and retrieves data.
Distributed Algorithms
These are the rules and procedures nodes follow to
communicate and coordinate with each other.
System Management Tools
These tools help manage, monitor, and troubleshoot the
distributed system.
Cont.…
Distributed system architecture
How to organize the collection of software components
logical organization and
physical organization
i.e., software architectures: how they are organized and how
they communicate
We will discuss
architectural styles
system architectures: centralized vs decentralized ones
Architectural Styles(software architecture )
It is the logical organization of software components and
their interaction with other structures
Components are modules with well-defined interfaces that
can be replaced or reused.
Connectors are a mechanism that mediates
communication, coordination, or cooperation among
components, e.g., facilities for RPC, message passing, or
streaming data
There are various architectural styles
1. Layered architectures
2. Object-based architectures
3. Data-centered architectures
4. Event-based architectures
1. Layered architectures
In Layered architecture, different components are
organized in layers.
Each layer communicates with its adjacent layer by
sending requests and getting responses.
The layered architecture separates components into units.
Any layer can not directly communicate with another layer.
A layer can only communicate with its neighboring layer
and then the next layer transfers information to another
layer and so on the process goes on.
Cont.…
Request flow from top to bottom(downwards) and
response flow from bottom to top(upwards).
The advantage of layered architecture is that each layer
can be modified independently without affecting the whole
system.
This type of architecture is used in the Open System
Interconnection (OSI) model.
Cont.….
The layered architectural style
2. Object-based architectures
In this type of architecture, components are treated as
objects which convey information to each other.
Object-Oriented Architecture contains an arrangement of
loosely coupled objects.
Objects can interact with each other through method calls.
Objects are connected through the Remote Procedure Call
(RPC) mechanism or Remote Method Invocation (RMI)
mechanism.
Cont.…
Invocations of methods are how objects communicate with
one another.
Unlike layered architecture, object-based architecture
doesn’t have to follow any steps in a sequence.
Each component is an object, and all the objects can
interact through an interface (or connector).
Under object-based architecture, such interactions
between components can happen through a direct method
call.
each object corresponds to a component and these
components are connected through a remote procedure
call mechanism (client-server paradigm)
The object-based architectural style
3. Data-centered architectures
Data centered architecture is a type of architecture in
which a common data space is present at the center.
It contains all the required data in one place a shared data
space.
All the components are connected to this data space and
they follow the publish/subscribe type of communication.
It has a central data repository at the center.
Required data is then delivered to the components.
Distributed file systems, producer-consumer systems, and
web-based data services are a few well-known examples.
For example Producer-Consumer system.
The producer produces data in common data space and
consumers request data.
Cont.…
4. Event-Based Architecture
In event-based architecture, the entire communication is
through events.
Events are present at the center in the event bus and
delivered to the required component whenever needed.
When an event occurs, the system, as well as the receiver,
gets notified.
Sometimes, these events are data, and at other times they
are URLs to resources.
The components of this system are loosely coupled that’s
why it is easy to add, remove and modify them.
Heterogeneous components can communicate through the
bus.
The event-based architectural style
System Architectures
System-level architecture focuses on the entire system and the
placement of components of a distributed system across
multiple machines.
The client-server architecture and peer-to-peer architecture
are the two major system-level architectures that hold
significance today.
Centralized Architectures
The centralized architecture is defined as every node being
connected to a central coordination system, and whatever
information they desire to exchange will be shared by that
system.
Cont.…
• It consists following types of architecture:
Client-server
Application Layering
Client-server
Processes in a distributed system are split into two
(potentially overlapping) groups in the fundamental client-
server architecture.
A server is a program that provides a particular service,
such as a database service or a file system service.
Cont.…
• A client is a process that sends a request to a server and then
waits for the server to respond before requesting a service
from it.
• This client-server interaction, also known as request-reply
behavior is shown in the figure below:
Cont. …
communication between the client and server can be
by a connectionless protocol if the underlying network is fairly
reliable; efficient since there is not much overhead
but assuring reliability is difficult
when messages are lost or corrupted let the client send the request
again; applicable only for idempotent operations
an operation is idempotent if it can be repeated multiple times
without harm; e.g., reading a record in a database
by reliable connection-oriented protocol if the underlying network
is unreliable
establishing and terminating connections is expensive
Cont.….
Application Layering
Everything required to connect with the user, such as display
management directly, is contained at the user-interface level.
Applications are often found at the processor level.
The actual data that is used to make decisions is managed at
the data level.
Three levels exist for client-server architecture
The user-interface level: implemented by clients and contains
all that is required by a client; usually through GUIs, but not
necessarily.
The processing level: contains the applications
The data level: contains the programs that maintain the actual
data dealt with.
• e.g., the general organization of an Internet search engine into
three different layers
Client-Server Architectures
how to physically distribute a client-server application across
several machines
Multitiered Architectures
Two-tier architecture
In a two-tier architecture, the application logic is either
summed up within the user interface (UI) or the server's
database or occasionally in both.
The user system interface is usually located in the user’s
desktop environment
The database management services are usually in a server
which is a more powerful machine that services many clients
The two-tier architecture consists of two layers : Client Tier
and Database (Data Tier).
It is less secure as clients can communicate with the database
directly.
(a)put only he terminal-dependent part of the user interface on the
client machine and let the applications remotely control the
presentation.
(b)put the entire user-interface software on the client side
(c) move part of the application to the client, e.g. checking correctness
in filling out forms
(d) and (e) are for powerful client machines (more popular)
Three-Tier Architecture
In three-tier, the application logic or process lives in the
middle-tier, it is separated from the data and the user interface.
Three-tier architecture consists of three layer: Client Layer,
Business Layer, and Data Layer.
The client interacts with the middle layer, and this middle
layer interacts with the server which holds the data.
The middle layer processes and formats the data and sends it
back to the client.
The client does not know how the data is being fetched from
the server, making it stateless.
It is secured as client is not allowed to communicate with
database directly.
Most of the web applications are three-tier applications.
Cont.…
Decentralized Architectures
In decentralized architectures distribute tasks, data, and
responsibilities across all participating peers.
Each node can act independently and autonomously, without
relying on a central coordinator or leader.
In decentralized systems, every node makes its own decision.
There is no central authority or single point of control
There is no single entity that receives and responds to the
request.
Planning and decision-making are distributed evenly among
several independent entities or nodes.
Cont.…
Vertical distribution: the ones discussed so far where the
different tiers correspond directly with the logical organization
of applications;
place logically different components on different machines
Horizontal distribution: physically split up the client or the
server into logically equivalent parts
an example is a peer-to-peer system where processes are equal
and hence each process acts as a client and a server at the
same time (servent)
example for is the horizontal distribution of a Web service
End Of Chapter Two