Distributed Systems Chapter 1
Distributed Systems Chapter 1
Course Description
• A distributed system is a computer system consisting of several
independent computers, connected by a network, that can work
together to perform a task or provide a service.
• Typical examples include: the WWW, networked file systems,
DNS, and massive multiprocessor supercomputers.
• In this course we will focus on the principles, techniques, and
practices relevant to the design and implementation of such
systems.
• The course takes a systems-oriented view of distributed systems,
concentrating on infrastructure software and providing hands-on
experience of implementing distributed systems.
Course objectives
After completing this course, you will be able to:
• Explain what a distributed system is, why they would design a system as
a distributed system, and what the desired properties of such systems.
• List the principles underlying the functioning of distributed systems
describe the problems and challenges associated with distributed
systems, and evaluate the effectiveness and shortcomings of their
solutions.
• Recognize how the principles are applied in contemporary distributed
systems, explain how they affect the software design
• Design a distributed system that fulfills requirements with regards to key
distributed systems properties (such as scalability, transparency, etc.)
• Understand and exercise on distributed system software development
using basic OS mechanisms as well as higher-level middleware and
languages.
Course outline
Chapter 1: Introduction Chapter 2: Architectures
1.1. Introduction 2.1 Introduction
1.2. Definition of DS 2.2 Architectural Styles
1.3. Goals of a DS 2.3 System Architectures
1.4. Types of DS
• Centralized: A system where one central server controls everything and all
clients depend on it.
- Structure: Clients → communicate only with → Central Server.
• Decentralized System: Multiple central authorities exist, but they operate
independently.
- Structure: Several central nodes → each controls its own part.
• Distributed System: A collection of independent computers that appear to
users as one single system.
- Structure: Several central nodes → each controls its own part.
Distributed versus decentralized systems
Introduction From networked systems to distributed systems
Alternative approach
Two views on realizing distributed systems
• Integrative view: connecting existing networked computer systems into a
larger a system.
• Expansive view: an existing networked computer systems is extended
with additional computers
Definitions
• A distributed system is a collection of independent computers that
work together and appear to users as a single coherent system.
• “… a system in which the failure of a computer you didn’t even
know existed can render your own computer unusable.” Leslie
Lamport
• multiple computers communicating via a network…
• trying to achieve some task together
• Consists of “nodes” (computer, phone, car, robot, …)
Distributed versus decentralized systems
Introduction From networked systems to distributed systems
Sharing resources
Canonical examples
• Cloud-based shared storage and files
• Peer-to-peer assisted multimedia streaming (E.g. BitTorrent)
• Shared mail services (think of outsourced mail systems)
• Shared Web hosting (think of content distribution networks. E.g. Cloudflare)
Goal
“make remote resources feel accessible and usable across the network.”
Resource sharing
Introduction Design goals
Distribution transparency
What is transparency?
The phenomenon by which a distributed system attempts to hide the fact that
its processes and resources are physically distributed across multiple
computers, possibly separated by large distances.
Observation
Distribution transparancy is handled through many different techniques in a
layer between applications and operating systems: a middleware layer.
Distribution transparency
Introduction Design goals
Distribution transparency
Types
Transparency Description
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
Failure Hide the failure and recovery of an object
Distribution transparency
Introduction Design goals
Degree of transparency
Aiming at full distribution transparency may be too much
Distribution transparency
Introduction Design goals
Degree of transparency
Aiming at full distribution transparency may be too much
• There are communication latencies and bandwidth that cannot be hidden
• Latency: time until message arrives
• In the same building/datacenter: ≈ 1 ms
• One continent to another: ≈ 100 ms
• Bandwidth: data volume per unit time
• 3G cellular data: ≈ 1 Mbit/s
• Home broadband: ≈ 10 Mbit/s
Distribution transparency
Introduction Design goals
Degree of transparency
Aiming at full distribution transparency may be too much
• There are communication latencies and bandwidth that cannot be hidden
• Latency: time until message arrives
• In the same building/datacenter: ≈ 1 ms
• One continent to another: ≈ 100 ms
• Bandwidth: data volume per unit time
• 3G cellular data: ≈ 1 Mbit/s
• Home broadband: ≈ 10 Mbit/s
• Completely hiding failures of networks and nodes is (theoretically and
practically) impossible
• You cannot distinguish a slow computer from a failing one
• You can never be sure that a server actually performed an operation
before a crash
• Full transparency will cost performance, exposing distribution of the
system
• Keeping replicas exactly up-to-date with the master takes time
• Immediately flushing write operations to disk for fault tolerance
Distribution transparency
Introduction Design goals
Degree of transparency
Exposing distribution may be good
• Making use of location-based services (finding your nearby friends)
• For example, showing nearby friends, local events, or regional data
sources is easier if the system exposes distribution rather than hides it.
• When dealing with users in different time zones: Awareness of
distribution allows applications to manage time-sensitive interactions
effectively.
• When it makes it easier for a user to understand what’s going on (when
e.g., a server does not respond for a long time, report it as failing).
Conclusion
Distribution transparency is a nice goal, but achieving it is a different story, and
it should often not even be aimed at.
Distribution transparency
Introduction Design goals
Openness
Introduction Design goals
Dependability
Basics
A component provides services to clients. To provide services, the component
may require the services from other components ⇒ a component may depend
on some other component.
Requirement Description
Availability Readiness for usage (fraction of up-time)
Reliability Continuity of service delivery
Safety Very low probability of catastrophes
Maintainability How easy can a failed system be repaired
Dependability
Introduction Design goals
Availability
Availability: The system is operational and accessible when users need it.
In distributed systems: Because components are spread across multiple
nodes, failures are expected. Availability focuses on keeping the service
running despite those failures.
Limits to availability
• Frequency of system failures
– Redundancy can improve availability.
• Detection & repair time
– Detect, diagnose, repair failed component, restart the system
– Time to reconfigure to redundant standby.
• As a practical matter, 99.999% is considered “high availability”
– 99.999% “Five nines” ➔ ~5 minutes/year down time
– 99.9999% “Six nines” ➔ 31.5 seconds/year down time
Dependability
Introduction Design goals
Reliability
Definition: The system performs correctly and consistently over time.
In distributed systems: Messages can be delayed, lost, or duplicated. Reliability
ensures the system still produces correct results even with such issues.
Example: A banking system must process a transfer exactly once — not zero
times, not twice.
Dependability
Introduction Design goals
Terminology
Failure, error, fault
Dependability
Introduction Design goals
On security
Observation
A distributed system that is not secure, is not dependable
Security
Introduction Design goals
On security
Observation
A distributed system that is not secure, is not dependable
What we need
• Confidentiality: information is disclosed only to authorized parties
• Integrity: Ensure that alterations to assets of a system can be made only
in an authorized way
Security
Introduction Design goals
On security
Observation
A distributed system that is not secure, is not dependable
What we need
• Confidentiality: information is disclosed only to authorized parties
• Integrity: Ensure that alterations to assets of a system can be made only
in an authorized way
Security
Introduction Design goals
Security mechanisms
Keeping it simple
It’s all about encrypting and decrypting data using security keys.
Notation
K (data) denotes that we use key K to encrypt/decrypt data.
Security
Introduction Design goals
Security mechanisms
Symmetric cryptosystem
With encryption key EK (data) and decryption key DK (data):
if data = DK (EK (data)) then DK = EK . Note: encryption and descryption key
are the same and should be kept secret.
Asymmetric cryptosystem
Distinguish a public key PK (data) and a private (secret) key SK (data).
Security
Introduction Design goals
Security mechanisms
Secure hashing
In practice, we use secure hash functions: H(data) returns a fixed-length
string.
• Any change from data to data∗will lead to a completely different string
H(data∗).
• Given a hash value, it is computationally impossible to find a data with
h = H(data)
Security
Introduction Design goals
Security mechanisms
Secure hashing
In practice, we use secure hash functions: H(data) returns a fixed-length
string.
• Any change from data to data∗will lead to a completely different string
H(data∗).
• Given a hash value, it is computationally impossible to find a data with
h = H(data)
Security
Introduction Design goals
Horizontal scaling (scaling out), Adding more nodes (servers) to the system.
This involves horizontally increasing the number of servers working together.
• There are now basically three techniques for scaling out to be considered:
▪ Hiding communication latencies.(Shipping code)
▪ Distribution.
▪ Replication.
Scalability
Introduction Design goals
Scalability
Introduction Design goals
The difference between letting (a) a server or (b) a client check forms as they
are being filled.
Scalability
Introduction Design goals
Scalability
Introduction Design goals
Scalability
Introduction Design goals
Scalability
Introduction A simple classification of distributed systems
Parallel computing
Observation
▪ High-performance distributed computing started with parallel computing.
▪ Designed for high-performance computing, these systems use multiple
computers to solve a single, complex, or compute-intensive task.
▪ They often use cluster computing (homogeneous, fast local network) or
grid computing (heterogeneous, often wide-area) to process large
datasets or perform parallel computing.
Problem
Performance of distributed shared memory could never compete with that of
multiprocessors, and failed to meet the expectations of programmers. It has
been widely abandoned by now.
Cluster computing
Essentially a group of high-end systems connected through a LAN
• Homogeneous: same OS, near-identical hardware
• Single, or tightly coupled managing node(s)
Grid computing
The next step: plenty of nodes from everywhere
• Heterogeneous
• Dispersed across several organizations
• Can easily span a wide-area network
Note
To allow for collaborations, grids generally use virtual organizations. In essence,
this is a grouping of users (or better: their IDs) that allows for authorization on
resource allocation.
Basic approach
A networked application is one that runs on a server making its services available to
remote clients. Simple integration: clients combine requests for (different)
applications; send that off; collect responses, and present a result to the user.
Example workflow: Ask HR for employee info, Ask payroll for salary, Ask finance
for project cost, Combine into one report.
Issue: all-or-nothing
• Atomic: happens indivisibly (seemingly)
• Consistent: does not violate system invariants
• Isolated: not mutual interference
• Durable: commit means changes are permanent
Observation
Often, the data involved in a transaction is distributed across several servers. A
TP Monitor is responsible for coordinating the execution of a transaction.
Pervasive systems
Introduction A simple classification of distributed systems
Pervasive systems
Introduction A simple classification of distributed systems
Pervasive systems
Introduction A simple classification of distributed systems
Pervasive systems
Introduction A simple classification of distributed systems
Pervasive systems
Introduction A simple classification of distributed systems
Ubiquitous systems
Core elements
1. (Distribution) Devices are networked, distributed, and accessible
transparently
2. (Interaction) Interaction between users and devices is highly unobtrusive
3. (Context awareness) The system is aware of a user’s context to optimize
interaction
4. (Autonomy) Devices operate autonomously without human intervention,
and are thus highly self-managed
5. (Intelligence) The system as a whole can handle a wide range of dynamic
actions and interactions
Pervasive systems
Introduction A simple classification of distributed systems
Mobile computing
Distinctive features
• A myriad of different mobile devices (smartphones, tablets, GPS devices,
remote controls, active badges).
• Mobile implies that a device’s location is expected to change over time ⇒
change of local services, reachability, etc. Keyword: discovery.
• Maintaining stable communication can introduce serious problems.
• For a long time, research has focused on directly sharing resources
between mobile devices. It never became popular and is by now
considered to be a fruitless path for research.
Bottomline
Mobile devices set up connections to stationary servers, essentially bringing
mobile computing in the position of clients of cloud-based services.
Pervasive systems
Introduction A simple classification of distributed systems
Mobile computing
Pervasive systems
Introduction A simple classification of distributed systems
Sensor networks
Characteristics
The nodes to which sensors are attached are:
• Many (Scalability is non-negotiable)
Protocols must work whether there are 20 or 2,000 nodes.
• Simple (small memory/compute/communication capacity)
Each node is intentionally minimal — tiny CPU, tiny RAM, low-power radio.
• Often battery-powered (or even battery-less)
Pervasive systems
Introduction A simple classification of distributed systems
Centralized Processing: All sensor data is sent directly to an operator's site for
storage and analysis.
Distributed Processing: Each individual sensor has the power to process and
store its own data. In this model, the operator sends a query to the network, and
the sensors send back only the specific answers needed.
Pervasive systems
Introduction A simple classification of distributed systems
Pervasive systems
Introduction Pitfalls