0% found this document useful (0 votes)
37 views

Chapter 2

Uploaded by

Legesse Samuel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Chapter 2

Uploaded by

Legesse Samuel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

CHAPTER 2- ARCHITECTURES

1
INTRODUCTION
There are different ways on how to view the
organization of a distributed system;
• i.e. logical and physical organization (software & system
architecture)
Software Architecture:
• describe the organization and interaction of software
components
• tell us how the various software components are to be
organized and how they should interact.
System Architectures:
• describe the placement of software components on
physical machines.
 The realization of an architecture may be:

 centralized (most components located on a single machine),


 decentralized (most machines have approximately the same
functionality), or 2
 hybrid (some combination).
ARCHITECTURAL STYLES
An architectural style describes a particular way to
configure a collection of components and connectors.
Component - a module with well-defined interfaces; that is
reusable, replaceable within its environment.
Connector - a mechanism that mediates communication,
coordination, or cooperation among components.

various architectural styles for distributed systems are:


1. Layered architectures

2. Object-based architectures

3. Data-centered architectures
ƒ

4. Event-based architectures 3
1. LAYERED ARCHITECTURES
components are organized in a layered fashion where
a component at layer LN is allowed to call components
at the underlying layer LN-1, but not the other way
around;
requests go down the hierarchy and results flow upward
• e.g., network layers

Fig 2.1: the layered architectural style 4


2. OBJECT-BASED ARCHITECTURES
each object corresponds to a component, and these
components are connected through a remote procedure
call mechanism.
this software architecture matches the client-server
system architecture.

The layered and object-based


architectures still form the most
important styles for large
software systems.
5
Fig 2.2: the object-based architectural style
3. DATA-CENTERED ARCHITECTURES
processes communicate through a common repository.
• Processes interact by reading and modifying data in some
shared repository (active or passive)
Traditional data base (passive): responds to requests
Blackboard system (active): clients solve problems collaboratively;
system updates clients when information changes.

Example:
• a shared distributed file system:
• all communication takes place through files.
• Web-based distributed systems:
• processes communicate through the use of shared Web-based data
services.

6
4. EVENT-BASED ARCHITECTURES
Processes communicate through the propagation of
events, (can also optionally carry data)
event propagation has been associated with
publish/subscribe systems
processes publish events after which the middleware
ensures that only those processes that subscribed to
those events will receive them.

Advantage:
processes are loosely coupled; they need not explicitly refer to
each other.

7
CONT…

Fig 2.3a: The event-based Fig 2.3b: The shared data-space


architectural style architectural style

Shared data spaces:


combination of event-based and data-centered architectures.
processes are now also decoupled in time:
they need not both be active when communication takes place.
8
i.e. processes communicate asynchronously.
GROUP DISCUSSION

What makes these software architectures important for


distributed systems?

they all aim at achieving distribution transparency


transparency requires making trade-offs between performance,
fault tolerance, ease-of-programming, and so on.
Different distributed applications require different solutions
or architectures.

9
SYSTEM ARCHITECTURES
tells us the actual physical realization of components.
how are processes organized in a system.
where do we place software components.

deciding on software components, their interaction, and


their placement is what system architecture is all about.

can be centralized, decentralized or a hybrid.

10
CENTRALIZED ARCHITECTURES
traditional client-server structure.
vertical (or hierarchical) organization of communication
and control paths (as in layered software architectures).
logical separation of functions into client (requesting
process) and server (responder).
a server is a process implementing a specific service
a client is a process that requests a service from a server by
sending a request and waiting for a reply
have a request-reply behavior

Fig.2.4: general interaction


b/n a client and a server
11
CONT…
communication between a client and a server can be:
by a connectionless protocol
when the underlying network is fairly reliable (in LAN).
its advantage is being efficient; as long as messages do not
get lost or corrupted, the request/reply protocol just
sketched works fine.
making the protocol resistant to occasional transmission
failures is not trivial;
the client resend the request when no reply message comes in.
but, the client cannot detect whether the original request message
was lost, or that transmission of the reply failed.
it is applicable only for idempotent operation; when an operation
can be repeated multiple times without harm.
by a reliable connection-oriented protocol
when the underlying network is unreliable (in WAN)
ƒestablishing and terminating connections is expensive
For example; almost all Internet application protocols are
12
based on reliable TCP/IP connections
CONT…
Application Layering
there are many controversies about the client-server
model; no clear distinction between a client and a server.
For example: a server for a distributed database may act as
a client when it forwards requests to different file servers.
three levels of distribution (following the layered
architecture):
the user-interface level: implemented by clients and
contains all that is necessary to directly interface with the
user, such as display management.
the processing level: contains the (data processing)
ƒ
applications; contains the core functionality of an application.
the data level: manages the actual data that is being acted
ƒ
on; interacts with data base or file system.
13
CONT…
Example
Web search engine
Interface: type in a keyword string
Processing level: processes to generate DB queries, rank
replies, format response
Data level: database of web pages

Desktop “office suites”


Interface: access to various documents, data,
Processing: word processing, database queries, spreadsheets,…
Data : file systems and/or databases

14
CONT…

Fig.2.5: the general organization of an Internet search


engine into three different layers 15
CONT…

how to physically distribute a client-server application


across several machines;
mapping the software architecture to system hardware.
correspondence between logical software modules and actual
computers.

Multi-tiered architectures
Layer and tier are roughly equivalent terms, but layer
typically implies software and tier is more likely to refer to
hardware.
Two-tier and three-tier are the most common.

16
TWO-TIERED (C/S) ARCHITECTURES
Server provides processing and data management;
client provides simple graphical display (thin-client).
Perceived performance loss at client
Easier to manage, more reliable, client machines
don’t need to be so large and powerful

At the other extreme, all application processing and


some data resides at the client (fat-client approach).
Pro: reduces work load at server; more scalable
Con: harder to manage by system admin, less secure

17
CONT…

18
Fig. 2.6: Two-tiered architecture: alternative client-server organizations
CONT…
a) put only terminal-dependent part of the user interface
on the client machine and give the applications remote
control over the presentation of their data.
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 forms.
a) to c) are for thin clients.
d) and e) are for fat clients; more popular.
used for powerful client machines, connected through a
network to a distributed file system or database.
most of the application is running on the client machine, but
all operations on files or database entries go to the server.
difficult to manage since client-side software is distributed
and is prone to error; it is also dependent on the client’s 19
platform such as operating system
THREE-TIERED (C/S) ARCHITECTURES
In some applications servers may also need to be
clients, leading to a three level architecture;
Distributed transaction processing
Web servers that interact with database servers
Distribute functionality across three levels of machines
instead of two.

20

Fig. 2.7: An example of a server acting as client


DECENTRALIZED ARCHITECTURES
vertical distribution: client-server architecture;
placing logically different components on different machines.
each level serves a different purpose in the system.
horizontal distribution: decentralized architecture;
each node has roughly the same processing capabilities and
stores/manages part of the total system data.
a client or server may be physically split up into logically
equivalent parts,
but each part is operating on its own share of the complete data set. ƒ
Better load balancing, more resistant to denial-of-service
attacks, harder to manage than C/S.
Communication & control is not hierarchical; all about equal
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
21
same time.
Reading Assignment ; about the different approaches of
peer-to-peer architecture: pages 44 – 51.
HYBRID ARCHITECTURE
Combine client-server and P2P architectures
Edge-server systems; e.g. ISPs, which act as servers to their
clients, but cooperate with other edge servers to host
shared content.
Collaborative distributed systems; e.g., Bit Torrent, which
supports parallel downloading and uploading of chunks of a
file. First, interact with C/S system, then operate in
decentralized manner.

22
CONT…

 Fig. 2.8: viewing the Internet as consisting of a collection of edge


servers. 23
ARCHITECTURE VS MIDDLEWARE
Where does middleware fit into an architecture?
Middleware: the software layer between user
applications and distributed platforms.
Purpose: to provide distribution transparency.
applications can access programs running on remote nodes
without understanding the remote environment.
Middleware may also have an architecture
Use of a specific architectural style can make it easier to
develop applications, but it may also lead to a less flexible
system.
Possible solution: develop middleware that can be
customized as needed for different applications.

24
GROUP DISCUSSION
 If a client and a server are placed far apart, we may see
network latency dominating overall performance. How
can we tackle this problem?

 It depends on how the client is organized;


 divide the client-side code into smaller parts that
can run separately.
 b/c when one part is waiting for the server to respond, we
can schedule another part.
 rearrange the client; so that it can do other work after
having sent a request to the server .
 this replaces the synchronous client-server communication
with asynchronous one-way communication.
25
END

26

You might also like