Unit 2
Unit 2
• Architecture
DN_NC_BCA_VI_DS_unit2 1
Architectural styles
• Distributed systems are often complex pieces components that are
dispersed across multiple machines
• The organization of distributed systems is mostly about the software
components that constitute the system.
• These software architectures tell us how the various software
components are to be organized and how they should interact.
• Component: A modular unit with well-defined interfaces;
replaceable; reusable.
• Connector: A communication link between modules which
mediates coordination or cooperation among components.
DN_NC_BCA_VI_DS_unit2 2
Types of architectural styles
1. Layered architecture
2. Object based architecture
3. Data centered architecture
4. Event based architecture
DN_NC_BCA_VI_DS_unit2 3
Layered architectures
• Components are organized in layered fashioned
• Interaction is sequential where a layer
communicate with adjacent layer.
• A layer on the bottom provides a service to the
layer on the top
• The request follows from top to bottom whereas
the response is sent from bottom to top.
• -similar to OSI model
• Advantage
• The call always follows a predefined path
• Each layer can be easily replaced or modified
without affecting the entire architecture.
DN_NC_BCA_VI_DS_unit2 4
Object based
architecture
1. Based on the loosely coupled
arrangements of objects
2. No specific architecture→ do not
have sequential set of steps as in
layered architecture
3. Each components are referred to as
objects,
4. Each objects interacts with another
objects using connector
5. connector can be RMI or RPC
6. Communication between the objects
happen as a method call
DN_NC_BCA_VI_DS_unit2 5
Data centered
architecture
1. Based on data center- Primary
communication happens with central
data repository
2. The common repository can be either
active or passive
3. This is like a produce consumer
problem
4. The producer produces items to
common data store and consumer can
request from it.
5. All the information related related to
the node in the system are sored in the
persistent storage.
DN_NC_BCA_VI_DS_unit2 6
Event based architecture
• Communication happens through events
• When an event is generated it will be sent to the bus system
• Every other component get notification of the occurred events
• If anyone wants , then event is pulled from bus and use it.
• Process communicate through the propagation of events.
• One major advantage is that heterogenous components can
contact bus to handle incoming request and process
accordingly
• It is based on publisher subscriber architecture
• No direct communication between components but through
the bus
• Events can be
• Publisher subscriber
• Point to point
• broadcast
DN_NC_BCA_VI_DS_unit2 7
Middleware organization
DN_NC_BCA_VI_DS_unit2 8
Middleware
• Middle is a computer software that provides services to the software
applications beyond those available from the operating system.
• Layer between OS and distributed applications.
• Hides complexity and heterogeneity of distributed system
DN_NC_BCA_VI_DS_unit2 9
Middleware organization
DN_NC_BCA_VI_DS_unit2 10
Middleware organizations
• To assist the development of distributed applications, distributed
systems are often organized to have a separate layer of software that
is placed on top of the respective operating systems of the
computers that are part of the system. This organization is shown ,
leading to what is known as middleware .
• middleware is the same to a distributed system as what an operating
system is to a computer:
• a manager of resources offering its applications to efficiently share
and deploy those resources across a network.
• Next to resource management, it offers services that can also be
found in most operating systems, including
DN_NC_BCA_VI_DS_unit2 12
Middleware organizations
• Facilities for inter application communication.
• Security services.
• Provides high level abstraction such as RMI
• Enables location transparency
• interoperability
• Free from specifies of
• communication protocol
• Operating system and communication hardware
DN_NC_BCA_VI_DS_unit2 13
System architecture
• Centralized architecture
• Decentralized architecture
• Peer to peer architecture
DN_NC_BCA_VI_DS_unit2 17
Centralized system/ client server architecture
• In the basic client-server model,
• processes in a distributed system are divided into two groups.
• A server is a process implementing a specific service, for example, a
file system service or a database service.
• A 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 client-server interaction, also known as request-reply behavior is
shown in Fig. 2-3
DN_NC_BCA_VI_DS_unit2 18
Centralized system
DN_NC_BCA_VI_DS_unit2 19
Centralized system
• In client server model, generally a single server may not be able to
serve to client request. The server can request another server for
processing the clients request (request forward). This approach where
one server request services with another server server is known as
server as a client approach.
DN_NC_BCA_VI_DS_unit2 20
Centralized system
DN_NC_BCA_VI_DS_unit2 21
Decentralized –peer to peer
• A peer-to-peer architecture, or P2P, is a network where members
connect directly with each other without any intermediary.
• One member can take on the role of both client and server, according
to their needs.
• Each machine in the network has an equal responsibility for sharing
resources across the entire system
• When one node goes down, the network still functions as normal
because other nodes are still able to communicate and share
information with each other. The communication between peers does
not require a centralized server that processes requests and
distributes data.
DN_NC_BCA_VI_DS_unit2 22
Decentralized -Peer to peer architecture
DN_NC_BCA_VI_DS_unit2 23
Contd..
• Pure P2P architectures provide much greater reliability and much
better performance than traditional client/server architectures
because there is no reliance on any central servers.
DN_NC_BCA_VI_DS_unit2 24
Difference between client server and peer to
peer
DN_NC_BCA_VI_DS_unit2 25
Assignment 2
• What are the different architectural styles of distributed system?
Explain each of them in detail
• What is middleware? What are different roles of middleware in
distributed system
• What are different types of system architecture? Explain with
necessary diagrams
• Can a server acts as a client ? Explain.
• Explain centralized and decentralized architecture with advantages
and disadvantages of each
DN_NC_BCA_VI_DS_unit2 26