Chapter 1 Introduction
Chapter 1 Introduction
2
Definition of a Distributed System
3
Examples of Distributed systems
Web Applications
E.g., Google search or Amazon e-commerce platform
Cloud computing
E.g., Google cloud, Microsoft Azure, …..
File sharing networks
E.g., Peer-to-peer systems like BitTorrent
Distributed databases
E.g., Apache Cassandra or Google Spanned
Blockchain
E.g., Bitcoin
4
Why Distributed?
Resource and Data Sharing
printers, databases, multimedia servers, ...
Availability, Reliability
the loss of some instances can be hidden
Scalability, Extensibility
the system grows with demand (e.g., extra servers)
Performance
huge power (CPU, memory, ...) available
Inherent distribution, communication
organizational distribution, e-mail, video
5
Problems of Distribution
Concurrency, Security
clients must not disturb each other
Privacy
e.g., when building a preference profile
unwanted communication such as spam
Partial failure
we often do not know where the error is (e.g., RPC)
Location, Migration, Replication
clients must be able to find their servers
Heterogeneity
hardware, platforms, languages, management
6
1.2 Organization and Goals of a Distributed System
to support heterogeneous computers and networks and
to provide a single-system view,
a distributed system is often organized by means of a
layer of software called middleware that extends over
multiple machines
10
Scalability in Distributed Systems can be measured at least in three
dimensions
11
Scalability problems: performance problems caused by
limited capacity of servers and networks
Concept Example
Single server for all users-mostly for security
Centralized services
reasons
Centralized data A single on-line telephone book
Doing routing based on complete
Centralized algorithms
examplesinformation
of scalability limitations
Scaling Techniques
how to solve scaling problems
the problem is mainly performance, and arises as a result of limitations in
the capacity of servers and networks (for geographical scalability)
Three possible solutions:
Hiding communication latencies,
Distribution, and
Replication
12
A. Hide Communication Latencies
is important to achieve geographical scalability
The basic idea is simple: try to avoid waiting for responses to
remote service requests
let the requester do other useful job
i.e., construct requesting applications that use only
asynchronous communication instead of synchronous
communication; when a reply arrives the application is
interrupted.
good for batch processing and parallel applications but not for
interactive applications
for interactive applications, move part of the job to the client to
reduce communication;
e.g. filling a form and checking the entries
13
(a) a server checking the correctness of field entries
(b) a client doing the job
14
D. Distribution
Distribution involves taking a component, splitting it into smaller parts
e.g., DNS - Domain Name System
divide the name space into zones
for details, see later in Chapter 4 - Naming
16
1.3 Hardware Concepts
All distributed systems consist of multiple CPUs and
Memory.
We can organize hardwares in several different ways in
term of their connection and communication
From Hardware perspective, we can divide distributed
systems into two broad categories:
Multiprocessor Systems
Multicomputer Systems
17
Hardware requirements
18
Multiprocessor Systems
OR
19
Multiprocessor Systems
20
Multiprocessor Systems
a bus-based multiprocessor
22
Switch Based Multi Processor Systems With Shared
Memory
23
Crossbar switch
divide memory into modules and connect them to the
processors with a crossbar switch
at every intersection, a crosspoint switch is opened and closed
to establish connection
problem: expensive; with n CPUs and n memories, n 2 switches
are required
Cross Bar
Switch Based Multi
Processor Systems
With Shared Memory
24
Omega network
use switches with multiple input and output lines
drawback: high latency because of several switching
stages between the CPU and memory
Omega Switch
Based Multi Processor
Systems With Shared
Memory
25
1.3.2 Multicomputer Systems
26
1.3.2 Multicomputer Systems(cont.)
27
Homogeneous Multicomputer Systems
28
Homogeneous Multicomputer Systems(cont.)
29
Homogeneous Multicomputer Systems
Switch-based
messages are routed through an interconnection network
two popular topologies: meshes (or grids) and
hypercubes
Hypercube
Grid(meshe)
30
Heterogeneous Multicomputer Systems
31
1.4 Software Concepts
32
1.4 Software Concepts(cont.)
34
Distributed Operating Systems
35
Multiprocessor Operating Systems
36
Multiprocessor Operating Systems(cont.)
Semaphore:
Can be thought of as an integer with two atomic operations:
Down
Up
Monitor:
a programming language construct consisting of procedures
and variables that can be accessed only by the procedures of
the monitor;
Only a single process at a time is allowed to execute a
procedure
Goal:
To ensure orderly access to shared resources and prevent
issues like race conditions, deadlocks, or data inconsistencies.
To ensure replicated databases are up-to-date
37
Multicomputer Operating Systems
Totally different structure and complexity than multiprocessor OSs.
Processors can not share memory; instead communication is through message passing
each node has its own
kernel for managing local resources
separate module for handling interprocessor communication
They are organized as follows:
39
Distributed Shared Memory Systems
Practice showed that programing multicomputers is much harder than programing multiprocessor.
The deference caused by communication way, i.e., shared memory and message passing
In message passing, issues like buffering, blocking and reliable communication make things worse.
For this reason, researcher try to implement shared memory communication way on multicomputer systems.
The goal is to provide a virtual shared memory machine running on a multicomputer systems.
40
Distributed Shared Memory Systems(cont..)
Page-based distributed shared memory (DSM) - uses the virtual memory
capabilities of each individual node.
44
Middleware
a distributed operating system is not intended to handle a
collection of independent computers but provides
transparency and ease of use
a network operating system does not provide a view of a
single coherent system but is scalable and open
combine the scalability and openness of network operating
systems and the transparency and ease of use of distributed
operating systems
this is achieved through a middleware, another layer of
software
45
• Positioning Middleware
• The goal is to hide heterogeneity
46
Middleware models
47
a comparison between multiprocessor operating systems,
multicomputer operating systems, network operating
systems, and middleware-based distributed systems
Distributed OS
Network Middleware
Item
Multiproc Multicomp OS -based OS
Degree of
Very High High Low High
transparency
Same OS on all nodes Yes Yes No No
Number of copies of
1 N N N
OS
Basis for Shared Model
Messages Files
communication memory specific
Global, Global,
Resource management Per node Per node
central distributed
Scalability No Moderately Yes Varies
Openness Closed Closed Open Open
48
1.5 The Client-Server Model
49
Application Layering
no clear distinction between a client and a server;
for instance a server for a distributed database may act as a
client when it forwards requests to different file servers
three levels exist
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
50
the general organization of an Internet search engine into three
different layers
51
Client-Server Architectures
how to physically distribute a client-server application across several machines
One approach is Multi-tiered Architectures and can be divided into two groups:
Two tiered architecture
Three tiered architecture
52
Two tiered architecture
53
Three tiered architecture
54
Modern Architectures
Utilize vertical distribution and horizontal distribution to design scalable, efficient, and fault-tolerant
systems.
These architectures define how components are distributed in a system.
Two architectures:
Vertical distribution:
horizontal distribution:
55
Modern Architectures(cont.)
Vertical distribution:
Vertical distribution refers to distributing different functions
or layers of a system across various nodes or machines.
It is commonly seen in tiered architectures, where
responsibilities are divided by their role or function (e.g.,
presentation, application, and data storage)
Key Characteristics:
Focuses on functional separation.
Commonly follows multi-tiered models like 2-tier or 3-tier
architectures.
Communication occurs vertically between layers, with each layer
dependent on the others.
Real-World Use Cases:
E-commerce Platforms and Enterprise Applications
56
Modern Architectures(cont.)
Horizontal distribution:
physically split up the client or the server into
logically equivalent parts. e.g. Web server
Horizontal distribution involves duplicating or
replicating the same components or functions across
multiple nodes.
It focuses on scaling out to handle larger workloads or
improve fault tolerance.
Key Characteristics:
Focuses on scalability and redundancy.
Components at the same level perform similar tasks.
Often associated with load balancing and replication.
Examples:
Cluster Computing, Content Delivery Networks, and Distributed
Databases 57
Modern Architectures(cont.)
58
Modern Architectures(cont.)
59
Thank You!
60