Chapter 1-Introduction (1)
Chapter 1-Introduction (1)
Introduction
1.1 Introduction and Definition
before the mid-80s, computers were
very expensive (hundred of thousands or even
millions of dollars)
very slow (a few thousand instructions per second)
not connected among themselves
after the mid-80s: two major developments
cheap and powerful microprocessor-based
computers appeared
computer networks
LANs at speeds ranging from 10 to 1000 Mbps
WANs at speed ranging from 64 Kbps to
gigabits/sec
consequence
feasibility of using a large network of computers to
work for the same application; this is in contrast to
08.05.25 2
the old centralized systems where there was a single
What is a distributed system ?
A distributed system is:
A collection of autonomous/independent
computing elements that appears to its
users as a single coherent system.
3
Other Definitions
08.05.25
4
Collection of autonomous nodes
Autonomous computing elements also called
nodes
Can be of either HW or SW
Behave independently of each other
Each node have its own notion of time
There is no global clock.
Leads to fundamental synchronization and coordination
problems.
However, these nodes collaborate to achieve
a common goal
Realized by exchanging messages with each
other
5
Coherent system
A single coherent system – users believe they
are dealing with a single system
The difference between components as well as the
communication between them are hidden from users
Users can interact in a uniform and consistent way
regardless of where and when interaction takes place
Examples
An end user cannot tell where a computation is taking place
Where data is exactly stored should be irrelevant to an
application
If or not data has been replicated is completely hidden
Note:- Autonomous elements have to
collaborate to achieve this goal
6
Examples of distributed system
• Peer to Peer System
08.05.25 7
• Datacenter
08.05.25 8
What is centralized systems
Centralized computing is computing done at a central location,
using terminals that are attached to a central computer.
The computer itself may control all the peripherals directly (if they
are physically connected to the central computer), or they may be
attached via a terminal server
08.05.25 9
Centralized vs Distributed Systems
Centralized
One component with non-autonomous parts
Component shared by users all the time
All resources accessible
Software runs in a single process
Single point of control
Single point of failure
Distributed
Multiple autonomous components
Components are not shared by all users
Resources may not be accessible
Software runs in concurrent processes on different processors
Multiple points of control and
Multiple points of failure
08.05.25 10
Parallel Systems
• Parallel Computing is a form of computation in which many
computations are carried out simultaneously, operating on the
principle that large problems can often be divided into smaller
ones, which are then solved concurrently (in parallel).
• In parallel computing, all processors have access to a shared
memory. Shared memory can be used to exchange information
between processors, tightly coupled systems.
• In distributed computing, each processor has its own private
memory (distributed memory). Information is exchanged by
passing messages between the processors, loosely coupled
systems.
08.05.25
11
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
08.05.25
12
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
08.05.25
13
Characteristics of Distributed Systems
differences between the computers and the ways they
communicate are hidden from users
users and applications can interact with a distributed
system in a consistent and uniform way regardless of
location
distributed systems should be easy to expand and scale
a distributed system is normally continuously available,
even if there may be partial failures
• Certain common characteristics can be used to assess distributed systems.
Heterogeneity
Openness
Security
Scalability
Failure Handling
Concurrency
08.05.25 Transparency 14
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.
18
Types of Transparency in a Distributed System
Transparenc Description
y
Access Hide differences in data representation and how an object is
accessed
Location Hide where an object is located
Relocation Hide that an object may be moved to another location while
in use
Migration Hide that an object may move to another location
Replication Hide that an object is replicated
Concurrency Hide that an object may be shared by several independent
users simultaneously
Failure Hide the failure and recovery of an object
Figure 1-2. Different forms of transparency in a distributed system (ISO, 1995) .
The term object refers to either process or resource
19
Questions
20
Openness
An open distributed system is essentially a system
that offers components that can easily be used by, or
integrated into other systems.
It often consists of component that originate from somewhere
as well
How?
Components adhere to standard rules that describe the
syntax and semantics of what services those components
have to offer
Define services through Interfaces using interface definition
language(IDL)
It captures only the syntax of services like function name,
parameter, return type etc
Semantics (what those services do) specified in natural
language
21
Openness
By openness we want to achieve
Interoperability
Implementations from different manufacturers can work
together by merely relying on the standard rules
Portability
Applications from one distributed system can be executed
on another distributed system that implements the same
interface
Extensibility
Easy to add or replaces components in the system
Flexibility
Easy to modify/customize the system/component to a
specific need
Flexibility is achieved by separating policy from
mechanism
22
Scalability
Scalability is the ability of a system, network, or process
to handle a growing amount of work in a capable
manner(with no significant loss of performance)
Measured in three dimensions
Size scalable
Can easily add more users or resources to the system
Geographically scalable
Can easily handle users and resources that may lie far
apart
Administratively scalable
Can easily managed even if it spans many independent
administrative organizations
23
Size Scalability problems
When services are implemented/running by means of a
single/few tightly coupled servers in the distributed
system.
The server, or group of servers, can simply become a
bottleneck when it needs to process an increasing number of
requests.
Root causes for size scalability problems with centralized
solutions
The computational capacity, limited by the CPUs
The storage capacity, including the transfer rate between
CPUs and disks(I/O transfer rate)
The network between the user and the centralized service
24
Size Scalability problems - Examples
25
Problems with geographical scalability
It is difficult to scale existing distributed systems that
were designed for local-area networks into WAN
Many distributed systems assume synchronous
client-server interactions:
Client sends request and waits for an answer.
Latency may easily prohibit this scheme.
WAN links are often inherently unreliable:
The effect is that solutions developed for local-area
networks cannot always work on wide-area system
Example, simply moving streaming video from LAN to WAN
is bound to fail.
Lack of multipoint communication(like broadcast),
Unlike LAN, a simple search broadcast cannot be deployed.
Solution is to develop separate naming and directory
services to find hosts and resources
26
Scaling techniques
There are basically three techniques for scaling:
1) Hiding communication latencies,
2) Partitioning and Distribution
3) Replication
27
Scaling techniques
1) Hiding communication latencies, it is
applicable in the case of geographical
scalability.
The basic idea is try to avoid waiting for
responses to remote service request as much
as possible.
Make use of asynchronous communication
Make request and do other useful work up until the
response turned in
Problem: not every application fits this model.
Reduce the overall communication between client and
server
Move computations to client
See next slide
28
Scaling Techniques (1)- Hide latency
30
Scaling Techniques (2)- Distribution
32
Pitfalls when Developing Distributed Systems
False assumptions made by first time developer:
• The network is reliable.
• The network is secure.
• The network is homogeneous.
• The topology does not change.
• Latency is zero.
• Bandwidth is infinite.
• Transport cost is zero.
• There is one administrator.
• Note:-
• When one of these fail, it is difficult to mask unwanted
behavior
• Most of these issues will not most likely show up in non-
distributed applications development
33
Types of distributed systems
Three types of distributed systems
1. High performance distributed computing systems
2. Distributed information systems
3. Distributed systems for pervasive computing
34
1. Distributed Computing Systems
Used for high performance computing tasks
Examples distributed computing systems
Cluster computing systems
Grid computing systems
Cloud computing systems
35
Cluster Computing Systems
In virtually all cases, cluster computing is used for parallel
programming in which a single (compute intensive) program
is run in parallel on multiple machines.
A typical cluster system consists of a collection of compute
nodes that are controlled and accessed by means of a single
master node.
Nodes are connected through a LAN.
Nodes are essentially homogeneous (Same OS, near-identical
hardware )
The master node typically handles
The allocation of nodes to a particular parallel program,
Maintains a batch queue of submitted jobs, and
Provides an interface for the users of the system.
Batch processing is a technique for automating and processing multiple transactions as a single group.
36
Example cluster configuration
General configuration of Linux-based cluster called
Beowulf
38
Cloud computing
Provides computing services and resources
(hardware and software) over a network/internet
Cloud computing is based upon the concept of utility
computing
Customers shall pay only based on a pay-per-use
model
It is characterized by an easily usable and
accessible pool of virtualized resources
It is scalable as users can get more resources if more
work needs to be done
39
Cloud computing
In practice, clouds are organized into four layers
Hardware – contains resources customers never get to see
directly.
Infrastructure - Employs virtualization techniques to provide
customers virtual storage and computing resources
Platform – provides API (Application Programming Interface )for developing
Apps, Storage
Application – Actual applications like suite of apps shipped
with OSes
40
2. Distributed Information Systems
Enterprises might already have multiple networked
information systems
One that makes its services available to remote clients.
Example a University might have Registrar system, HRM
system etc….
However, integrating applications into enterprise
wide information system was painful
Middleware is the solution
Applications can be integrated at different levels
Database level
That results in Distributed Transaction Processing
Application level
Enterprise Application Integration (EAI)
41
Transaction Processing Systems
Consider database applications
special primitives are required to program
transactions, supplied either by the underlying
distributed system or by the language runtime system
exact list of primitives depends on the type of
application
Primitive Description
BEGIN_TRANSACTION Mark the start of a transaction
Terminate the transaction and try to
END_TRANSACTION
commit
ABORT_TRANSACTIO Kill the transaction and restore the
N old values
Read data from a file, a table, or
READ
otherwise
Write data to a file, a table, or
WRITE
08.05.25 otherwise 42
The Transaction Model
the model for transactions comes from the world of
business
a supplier and a retailer negotiate on
price
delivery date
quality
etc.
until the deal is concluded they can continue
negotiating or one of them can terminate
but once they have reached an agreement they are
bound by law to carry out their part of the deal
transactions between processes is similar with this
scenario
08.05.25 43
e.g. reserving a seat from DD to Bhardar through AA and
Mekelle airports
BEGIN_TRANSACTION BEGIN_TRANSACTION
reserve DD AA; reserve DD AA;
reserve AA mekelle; reserve AA mekelle;
reserve mekelle bhardar; reserve mekelle bhardar full
END_TRANSACTION ABORT_TRANSACTION
(a) (b)
08.05.25
44
properties of transactions(ACID)
1. Atomic: to the outside world, the transaction happens
indivisibly; a transaction either happens completely or not at all;
intermediate states are not seen by other processes
2. Consistent:
- transaction does not violate system invariants;
- ensures that corruption or errors in your data do not create
unintended consequences for the integrity of your table.
3. Isolated or Serializable:
- when multiple users are reading and writing from the same
table all at once, isolation of their transactions ensures that the
concurrent transactions don't affect one another.
4. Durable:
- ensures that changes to your data made by successfully
executed transactions will be saved, even in the event
of system failure; see later in Chapter 8
08.05.25
45
Classification of Transactions
a transaction could be flat, nested or distributed
Flat Transaction
consists of a series of operations that satisfy the ACID
properties
simple and widely used but with some limitations
do not allow partial results to be committed or
aborted
atomicity is also partly a weakness
in our airline reservation example, we may want
to accept the first two reservations and find an
alternative one for the last
some transactions may take too much time
08.05.25
46
Nested Transaction
constructed from a number of sub transactions; it is
logically decomposed into a hierarchy of sub
transactions
the top-level transaction forks off children that run in
parallel, on different machines; to gain performance or
for programming simplicity
each may also execute one or more sub transactions
permanence (durability) applies only to the top-level
transaction; commits by children should be undone
Distributed Transaction
a flat transaction that operates on data that are
distributed across multiple machines
problem: separate algorithms are needed to handle
the locking of data and committing the entire
08.05.25
transaction; 47
(a) a nested transaction
(b) distributed transaction
08.05.25
48
Enterprise Application Integration
how to integrate applications independent from their
databases
transaction systems rely on request/reply
how can applications communicate with each other
08.05.25
50
three requirements for pervasive applications
embrace contextual changes: a device is aware
that its environment may change all the time
encourage ad hoc composition: devices are used
in different ways by different users
recognize sharing as the default: devices join a
system to access or provide information
examples of pervasive systems
Home Systems
Electronic Health Care Systems
Sensor Networks