Chapter 1: Introduction - Computer...

32
1/29 Chapter 1: Introduction

Transcript of Chapter 1: Introduction - Computer...

1/29

Chapter 1: Introduction

2/29

What is a Distributed System?

I A distributed system is a collection of independent computersthat appears to its users as a single coherent system.

3/29

Characteristics of a Distributed System (1)

I Collection of autonomous computing elementsI Computing elements (or nodes) can be hardware and/or

softwareI No global clockI Group membership is difficult: Open groups versus Closed

groupsI Often organized as an overlay network: structured,

unstructured, peer-to-peer

4/29

Characteristics of a Distributed System (2)

I Single coherent systemI Requires transparency: process execution and data storageI Often implemented using middleware: a separate layer of

software that is logically placed on top of the operating systemsof the computers that are part of the distributed system.

I It handles resource management, interapplicationcommunication, masking of and recovery from failures,security and accounting services.

5/29

Examples (1)

The Internet is just a world passing around notes in a classroom. –Jon Stewart

5/29

Examples (1)

The Internet is just a world passing around notes in a classroom. –Jon Stewart

6/29

Examples (2)

6/29

Examples (2)

6/29

Examples (2)

7/29

Examples (3)

I Google search, GMail, Google Docs, et alI AmazonI Facebook, Twitter, EBayI LinkedIn, WhatsApp, Instagram, Snapchat, UberI Hadoop, Hive, Zookeeper, et alI No-SQL Databases like HBase, Cassandra, MongoDB, et alI Distributed file systems: NFS (Network File System), Google File

System (GFS), Hadoop Distributed File System (HDFS), Amazon S3,Lustre, GlusterFS, Parallel Virtual File System (PVFS)

I P2P: Peer to Peer: Bit Torrent, GnutellaI Domain Name System (DNS)I Git: distributed version control system.I SETI: a distributed computing project in which volunteers donate idle

computer power to analyze radio signals for signs of extraterrestrialintelligence.

I Folding@home (FAH or F@h): a distributed computing project fordisease research that simulates protein folding, computational drugdesign, and other types of molecular dynamics.

I Bitcoin: decentralized digital currencyI Virtually every substantial website!

8/29

Goals of a Distributed System?

I Makes resources accessibleI Reasonably hides the fact that resources are distributed across

a network (Transparency)I OpenI Scalable

9/29

Making Resources Accessible

I BenefitsI Better economics by sharing expensive resourcesI Easier to collaborate and exchange informationI Create virtual organizations where geographically dispersed

people can work together using groupwareI Enables electronic commerce

I ProblemsI Eavesdropping or intrusion on communicationI Tracking of communication to build a profile

10/29

Transparency

Type DescriptionAccess Hide differences in data representation and how a resource is accessedLocation Hide where a resource is locatedMigration Hide that a resource may move to another locationRelocation Hide that a resource may move to another location while in useReplication Hide that a resource has multiple copiesConcurrency Hide that a resource may be shared by several competitive usersFailure Hide the failure and recovery of a resource

11/29

Degree of Transparency

Completely hiding the distribution aspects from users is not alwaysa good idea in a distributed system.

I Attempting to mask a server failure before trying another onemay slow down the system

I Expecting several replicas to be always consistent coulddegrade performance unacceptably

I For mobile and embedded devices, it may be better to exposedistribution rather than trying to hide it

I Signal transmission is limited by the speed of light as well asthe speed of intermediate switches

12/29

Openness

An open distributed system offers services according to standardrules that describe the syntax and semantics of those services.

I Use of standard protocols.I Services are described via interfaces, which are often describe

via an Interface Definition Language (IDL). Interfaces onlyspecify syntax so semantics is left to the ambiguities of naturallanguage.

I Interoperability, Portability, Extensibility.I Separating policy from mechanism. For example: caching in a

web browser.

13/29

Scalability

Scalability can be measured against three dimensions.

I Size: be able to easily add more users and resources to asystem

I Geographical: be able to handle users and resources that arefar apart

I Administrative: be able to manage even if it spansindependent administrative organizations

Centralized versus distributed implementations.

14/29

Centralized Solutions with Scalability Problems

I Centralized services.I Centralized data.I Centralized algorithms.

15/29

Distributed Approach

Characteristics of decentralized algorithms:

I No machine has complete information about the system state.I Machines make decisions based only on local information.I Failure of one machine does not ruin the algorithm.I There is no implicit assumption that a global clock exists.

In-class exercise. Simulate a centralized and a distributedalgorithm for the same problem in class!

16/29

Scaling Techniques

I Hiding communication latencies: Examples would beasynchronous communication as well as pushing code down toclients (E.g. Javascript)

I Distribution: Taking a component, splitting into smaller parts,and subsequently spreading them across the system. (E.g.Domain Name System)

I Replication: Replicating components increases availability,helps balance the load leading to better performance, helpshide latencies for geographically distributed systems. Cachingis a special form of replication.

17/29

Distributed System Development Pitfalls

False assumptions made by first time developer (formulated byPeter Deustch).

I The network is reliableI The network is secureI The network is homogeneousI The topology does not changeI Latency is zeroI Bandwidth is infiniteI Transport cost is zeroI There is one administrator

“A distributed system is one in which the failure of a computer youdidn’t even know existed can render your own computer unusable."–Leslie Lamport

18/29

In-class Exercise

I Walk through architecture of various distributed systemsranging from: single server/client, multiple server/clients,point to point and others.

19/29

Types of Distributed Systems

I Distributed Computing SystemsI Cluster Computing SystemsI Grid Computing SystemsI Cloud Computing

I Distributed Information SystemsI Transaction Processing SystemsI Enterprise Application Integration

I Distributed Pervasive SystemsI Ubiquitous Computing SystemsI Mobile Computing SystemsI Sensor Networks

20/29

Cluster Computing

I A computer cluster is primarily used to run a single program in parallelon multiple machines. The program relies on parallel libraries andframeworks such as MPI (Message Passing Interface), MapReduce andothers.

I A computer cluster consists of a collection of compute and I/O nodesthat are controlled and accessed from a single master node. Themaster allocates nodes to a parallel program, maintains a queue ofsubmitted jobs and provides an interface to manage the cluster.

I A cluster usually has a dedicated high-speed interconnection networkand an optional administrative network.

21/29

Cloud Computing

I Cloud Computing provides the facilities to dynamicallyconstruct an infrastructure and compose what is needed fromavailable services.

Application

Infrastructure

Computation (VM) torage (block ), s , file

Hardware

Platforms

Software framework (Java/Python/.Net)Storage ( )databases

Infr

astr

uctu

re

aa

Svc

Pla

tfo

rm

aa

Svc

So

ftw

are

aa

Svc

MS AzureGoogle App engine

Amazon S3

Amazon EC2

DatacentersCPU, memory, disk, bandwidth

Web services, multimedia, business apps

Google docsGmailYouTube, Flickr

22/29

Layers of Cloud Computing

I Hardware: Processors, routers, power and cooling systems.Customers normally never get to see these.

I Infrastructure: Deploys virtualization techniques. Evolvesaround allocating and managing virtual storage devices andvirtual servers.

I Platform: Provides higher-level abstractions for storage andsuch. Example: Amazon S3 storage system offers an API for(locally created) files to be organized and stored in so-calledbuckets.

I Application: Actual applications, whether distributed or not.Includes apps such as office suites (text processors,spreadsheet applications, presentation applications).Comparable to the suite of apps shipped with traditional OSes.

23/29

Integrating Applications

I Situation: Organizations confronted with many networkedapplications, but achieving interoperability was painful.

I Basic approach: A networked application is one that runs ona server making its services available to remote clients. Simpleintegration: clients combine requests for (different)applications; send that off; collect responses, and present acoherent result to the user.

I Next step: Allow direct application-to-applicationcommunication, leading to Enterprise Application Integration(EAI).

24/29

Example EAI: Transaction Processing Systems (1)

Transaction primitives:

I BEGIN_TRANSACTIONI END_TRANSACTIONI ABORT_TRANSACTIONI READ, WRITE

ACID characteristic properties of transactions:

I Atomic: To the outside world, the transaction happens indivisiblyI Consistent: The transaction does not violate system invariantsI Isolated: Concurrent transactions do not interfere with each otherI Durable: Once a transaction commits, the changes are permanent

Transactions can be nested. Durability applies to top-level transactionsonly. For example: an airline and a hotel database. This led to the designof Transaction Processing Monitors (TP Monitors) to coordinate thecommitment of multiple subtransactions.

25/29

Example EAI: Transaction Processing Systems (2)

26/29

Enterprise Application Integration

Middleware as a communication facilitator for enterprise applicationintegration. This can be done in multiple ways. For example:

I Remote Procedure Call (RPC): Requests are sent through localprocedure call, packaged as message, processed, respondedthrough message, and result returned as return from call.

I Message Oriented Middleware (MOM): Messages are sent tological contact point (published), and forwarded to subscribedapplications.

27/29

Distributed Pervasive Systems

Characteristics of pervasive systems (aka Internet Of Things):

I Blends into the environmentI Encourage ad hoc compositionI Naturally distributedI Nodes are often small and battery poweredI Wireless/mobile communication is the norm

Examples: Ubiquitous Computing Systems, Mobile ComputingSystems, Sensor (and actuator) networks

28/29

In-class Exercise

In-class Exercise: Classify the distributed system examples wehave seen so far into the three categories: Distributed ComputingSystems, Distributed Information Systems, Distributed PervasiveSystems.

29/29

Chapter 1: Recommended Exercises

I Problem 1. What is the role of middleware in a distributedsystem?

I Problem 2. Explain what is meant by transparency, and giveexamples of different types of transparency.

I Problem 3. Scalability can be achieved by applying differenttechniques. What are these techniques?

I Problem 4. Give further examples of distributed pervasivesystems.