《分布式系统》研究生教学课件
分布式系统研究生教学课件,分布式系统,分布式,系统,研究生,教学,课件
Introduction of Introduction of Distributed SystemsDistributed SystemsOutlinev1.0 Motivationv1.1 Definition of A Distributed System v1.2 GoalsMaking Resources AccessibleDistribution TransparencyOpennessScalabilityPitfallsv1.3 Types of Distributed SystemsDistributed Computing SystemsDistributed Information SystemsDistributed Pervasive SystemsMotivationvResource sharing both physical resources and informationvComputation speedup to solve large problems,we will need many cooperating machinesvReliability-machines fail frequentlyvCommunication people collaborating from remote sitesvMany applications are by their nature distributed(ATMs,airline ticket reservation,etc)vTwo Main StimuliTechnological changeUser needsTechnology advancesvNetworkingvProcessorsvMemoryvStoragevProtocolNetwork ConnectivityThen:large companies and universities on Internetgateways between other networksdial-up bulletin boards1985:1,961 hosts on the Internet in the worldNow:One Internet(mostly)2011:600 million hosts on the Internet in China,2 billion in the worldwidespread connectivityHigh-speed WAN connectivity:1 1GbpsSwitched LANswireless networkingcomputing powervcomputers gotsmallercheaperpower efficientFastervmicroprocessors became technology leadersMemoryvmemory hierarchiescacheshide latency of main memory access,increase access bandwidthmemory gets denser,processors get fasterlarger cacheson-chip cache:1984:127bytes,today:multilevel caches:first introduced 1986,today:caching techniquesreduce or hide miss latenciescache-aware programmers/compliers/computersvStorage cost reducedMain Memoryyear$/MBtypical1977$32,00016K1987$250640K-2MB1997$264MB-256MB2007$0.06512MB-2GB+2013$0.014GB-8GB+9,000 x cheaper4,000 x more capacityStorage:disk131,000 x cheaper in 20 years30,000 x more capacityRecording density increased over 60,000,000 times over 50 years1977:310KB floppy drive$1480 1987:40 MB drive for$6792008:750 GB drive for$99,$0.13/GB2013:2TB drive for-$99,$0.05/GBProtocolsvFaster CPUmore time for protocol processingECC,checksums,parsing(e.g.XML)Image,audio compression feasiblevFaster network bigger and bloated protocols(e.g.,SOAP/XML,H.232)transfer more data(e.g.,music,movies,streaming data)vMore storagestore rich mediaMedia delivery and storagevAudioMPEG-3 telephone quality:8kbpsMPEG-3 FM quality:56-64 kbps 36hours/GBTelephone audio:64 kbpsMPEG-3 compressed near-CD audio:96 kbpsMPEG-3 CD quality audio:112 kbps 20 hours/GBCD quality audio:1.4 MbpsHDTV audio:3 MbpsvVideoMPEG-1 compressed NTSC video:1.5 Mbps 1.5 hours/GBJPEG compressed NTSC video:3-7 MbpsHDTV video:22-40 Mbps 4.5 minutes/GBvDigital moviesCompressed:45-65 GB/moviesDecompressed:1.6 TBStream at 1.5 Gb/secDevelopment of Computer Technologyv1950s:serial processors v1960s:batch processing v1970s:time-sharing v1980s:personal computingv1990s:parallel,network,and distributed processingv2000s:wireless networks and mobile computingv2010s:cloud computing and social computingPeople are distributedOutlinev1.0 Motivationv1.1 Definition of A Distributed System v1.2 GoalsMaking Resources AccessibleDistribution TransparencyOpennessScalabilityPitfallsv1.3 Types of Distributed SystemsDistributed Computing SystemsDistributed Information SystemsDistributed Pervasive SystemsDistributed System:Definition(1)vVery broad definitionA collection of independent computers that appears to its user as a single coherent system.Distributed systems are seamless:the interfaces among functional units on the network are for the most part invisible to the user.vTwo aspects(1)independent computers(2)single system =middleware.Distributed System:Definition(2)vDifferences between the various computers and the ways in which they communicate are mostly hidden from usersvUsers and applications can interact with a distributed system in a consistent and uniform way,regardless of where and when interaction takes place.A distributed system organized as middleware.The middleware layer extends over multiple machines,and offers each application the same interface.Goals of Distributed SystemsvMaking resources availablevDistribution transparencyvOpennessvScalabilityMake Resources AccessiblevAccess resources and share them in a controlled and efficient way.Printers,computers,storage facilities,data,files,Web pages,and networks,vConnecting users and resources also makes it easier to collaborate and exchange information.Internet for exchanging files,mail,documents,audio,and videovSecurity is becoming increasingly importantLittle protection against eavesdropping or intrusion on communicationTracking communication to build up a preference profile of a specific userDistribution TransparencynTransparencyTransparency:hide the fact that its processes and resources are physically distributed across multiple computers.nAccess Whats data representation?Connecting machines with different architecture and file-name conventionsnLocation Wheres the resource located?Naming is keynMigration Have the resource moved?nReplication Is the resource being move?nConcurrency Is anybody else accessing the resource now?nFailure Has it been working all along?Distribution TransparencyvNote:Distribution transparency may be set as a goal,but achieving it is a different story.Distributed System:DefinitionvDue to Lesli LamportA distributed system is“You know you have one when the crash of a computer youve never heard of stops you from getting any work done.”vThis description puts the finger on another important issue of distributed systems design:dealing with failures.Lesli LamportvLamport is best known for his seminal work in distributed systems and as the initial developer of the document preparation system LaTeX.vLamports research contributions have laid the foundations of the theory of distributed systems.Among his most notable papers are“Time,Clocks,and the Ordering of Events in a Distributed System”,which received the PODC Influential Paper Award in 2000“The Byzantine Generals Problem”“Distributed Snapshots:Determining Global States of a Distributed System”and“The Part-Time Parliament”.vThese papers relate to such concepts as logical clocks(and the happened-before relationship)and Byzantine failures.They are among the most cited papers in the field of computer science and describe algorithms to solve many fundamental problems in distributed systems,including:the Paxos algorithm for consensus,the bakery algorithm for mutual exclusion of multiple threads in a computer system that require the same resources at the same time andthe snapshot algorithm for the determination of consistent global states.Degree of TransparencyObservation:Aiming at full distribution transparency may be too much:vUsers may be located in different continents;distribution is apparent and not something you want to hidevCompletely hiding failures of networks and nodes is(theoretically and practically)impossibleYou cannot distinguish a slow computer from a failing oneYou can never be sure that a server actually performed an operation before a crashvFull transparency will cost performance,exposing distribution of the systemKeeping Web caches exactly up-to-date with the master copyImmediately flushing write operations to disk for fault toleranceDegree of TransparencyvDo we really want transparency?Impossible remote controlling a space shipA bad idea creating false expectationsAgainst applications goals pervasive computing and location awarenessScale in Distributed SystemsvObservation:Many developers of modern distributed system easily use the adjective“scalable”without making clear why their system actually scales.vScalability:At least three components:Number of users and/or processes(size scalability)Maximum distance between nodes(geographical scalability)Number of administrative domains(administrative scalability)Scalability Problems sizevDecentralized algorithms:No machine has complete information about the system state.Machines make decisions based only on local information.Failure of one machine does not ruin the algorithmThere is no implicit assumption that a global clock existsScalability Problems geographyvSynchronous communicationA party requesting service,generally referred to as a client,blocks until a reply is sent back.vWANs is unreliable and Point-to-pointvLANs provide reliable communication facilities based on broadcasting.vGeographical scalability is strongly related to the problems of centralized solutions that hinder size scalability.In addition,centralized components now lead to a waste of network resources.Scalability Problems administrationvIt is a difficult and in many cases open questionConflicting polices with respect to resource usage(and payment),management,and security.E.g.,Reside within a single domain can often be trusted by users that operate within that same domain.Downloading programs such as applets in Web browsers.Techniques for ScalingvHide communication latencies:Avoid waiting for responses;do something else:Make use of asynchronous communicationHave separate handler for incoming responseProblem:not every application fits this modelMove computations to clients(Java applets)vDistribution:Partition data and computations across multiple machines:Decentralized naming services(DNS)Decentralized information systems(WWW)vReplication/caching:Make copies of data available at different machines:Replicated file servers and databasesMirrored Web sitesWeb caches(in browsers and proxies)File caching(at server and client)Scaling Techniques Example(1)Technique:Offload work to clientsScaling Techniques Example(2)Technique:Divide the problem space.example:the way DNS divides the name space into zones.Scaling The ProblemvObservation:Applying scaling techniques is easy,except for one thing:Having multiple copies(cached or replicated),leads to inconsistencies:modifying one copy makes that copy different from the rest.Always keeping copies consistent and in a general way requires global synchronization on each modification.Global synchronization precludes large-scale solutions.vObservation:If we can tolerate inconsistencies,we may reduce the need for global synchronization.vObservation:Tolerating inconsistencies is application dependent.OpennessGoal:Open distributed system-able to interact with services from other open systems,irrespective of the underlying environment:vStandard rules(protocols/interfaces)to describe services/componentsInterfaced definitions should be:Complete&Vendor neutral These help making system/services should interoperable&portable vFlexibility ability to integrate multiple componentsvAchieving openness:At least make the distributed system independent from heterogeneity of the underlying environment:HardwarePlatformsLanguagesSeparating policy and mechanismTo achieve flexibility:split the systems in smaller components.Components requires support for different policies specified by applications and users:vExample web browser caching;Mechanism:caching infrastructurePolicy:what to cache,how large the cache is,cache replacement algorithms,Other examplesWhich operations do we allow downloaded code to perform?Which QoS requirements do we adjust in the face of varying bandwidth?What level of secrecy do we require for communication?Developing Distributed Systems:PitfallsvObservation:Many distributed systems are needlessly complex caused by mistakes that required patching later on.vMany possible false assumptions:The network is reliableThe network is secureThe network is homogeneousThe topology does not changeLatency is zeroBandwidth is infiniteTransport cost is zeroThere is one administratorOutlinev1.0 Motivationv1.1 Definition of A Distributed System v1.2 GoalsMaking Resources AccessibleDistribution TransparencyOpennessScalabilityPitfallsv1.3 Types of Distributed SystemsDistributed Computing SystemsDistributed Information SystemsDistributed Pervasive SystemsTypes of Distributed SystemsvDistributed computing systemsCommonly used in high-performance computingClustersGridsvDistributed information systemsDistributed transaction systemsEnterprise application integrationvDistributed pervasive systemsHome systemsHealth careSensor networksDistributed Computing Systems(1/2)vObservation:Many distributed systems are configured for High-Performance ComputingvCluster Computing:Essentially a group of high-end systems connected through a LAN:Homogeneous:same OS,near-identical hardwareSingle managing nodevBeowulf cluster configurationMaster node provides interface to user and handles job allocationsDistributed Computing Systems(2/2)vGrid Computing:lots of nodes from everywhere:HeterogeneousDispersed across several organizationsCan easily span a wide-area networkvKey issue sharing resources across organizations Thus,much pain goes into standards and interfacesvNote:To allow for collaborations,grids generally use virtual organizations.In essence,this is a grouping of users(or better:their IDs)that will allow for authorization on resource allocation.Distributed Computing Systems(2/2)vAn early example architecture for gridsFabric interfaces to local resourcesConnectivity communication protocols for supporting transactions using multiple resourcesResource management of a single resourceCollective handle access to multiple resourcesvA layered architecture for grid computing systems.Distributed Information SystemsvObservation:organizations that were confronted with a wealth of networked applications,but for which interoperability turned out to be a painful experience.Many of the existing middleware solutions are the result of working with an infrastructure in which it was easier to integrate applications into an enterprise-wide information systemvWe can distinguish several levels at which integration took place.Transaction Processing SystemsIn many cases,a networked application simply consisted of a server running that application(often including a database)and making it available to remote programs,called clients.Enterprise Application Integration(EAI)As applications became more sophisticated and were gradually separated into independent components(notably distinguishing database components from processing components),it became clear that integration should also take place by letting applications communicate directly with each other.Distributed information systemsvOrganizations have multiple networked applications how to integrate them?vFor database-oriented application&at the lowest level Transaction set of operation with ACID propertiesAtomic all or nothing at allConsistent if consistent before,consistent afterIsolated concurrent transactions dont interfere with each otherDurable once its done,its permanentNested transactions for distributed systemsPermanent?Only for the top-level transactionvTo integrate application independent from their databasesDifferent communication models:RPC,RMI,and MOMDistributed Information SystemsvObservation:The vast amount of distributed systems in use today are forms of traditional information systems,that now integrate legacy systems.vExample:Transaction processing systems.BEGIN TRANSACTION(server,transaction);READ(transaction,file-1,data);WRITE(transaction,file-2,data);newData:=MODIFIED(data);IF WRONG(newData)THENABORT TRANSACTION(transaction);ELSEWRITE(transaction,file-2,newData);END TRANSACTION(transaction);END IF;vEssential:All READ and WRITE operations are executed,i.e.their effects are made permanent at the execution of END TRANSACTION.vObservation:Transactions form an atomic operation.A nested transactionsvIs constructed from a number of subtransactionsGain performance or simplify programming.Transaction Processing MonitorvObservation:In many cases,the data involved in a transaction is distributed across several servers.A TP Monitor is responsible for coordinating the execution of a transaction:Distributed Information Systems:Enterprise Application IntegrationvProblem:A TP monitor works fine for database applications,but in many cases,the apps needed to be separated from the databases they were acting on.Instead,what was needed were facilities for direct communication between applications:Remote Procedure Call(RPC)Message-Oriented Middleware(MOM)Distributed Pervasive SystemsvObservation:There is a next-generation of distributed systems emerging in which the nodes are small,mobile,and often embedded as part of a larger system.Some requirements:Contextual change:The system is part of an environment in which changes should be immediately accounted for.Ad hoc composition:Each node may be used in a very different ways by different users.Requires ease-of-configuration.Sharing is the default:Nodes come and go,providing sharable services and information.Calls again for simplicity.vObservation:Pervasiveness and distribution transparency may not always form a good match.Pervasive Systems:ExamplesvHome Systems:Should be completely self-organizing:There should be no system administratorProvide a personal space for each of its usersSimplest solution:a centralized home box?vElectronic health systems:Devices are physically close to a person:Where and how should monitored data be stored?How can we prevent loss of crucial data?What infrastructure is needed to generate and propagate alerts?How can security be enforced?How can physicians provide online feedback?Sensor networksvCharacteristics:The nodes to which sensors are attached are:Many(10s-1000s)Simple(i.e.,hardly any memory,CPU power,or communication facilities)Often battery-powered(or even battery-less)vSensor networks as distributed systems:consider them from a database perspective:Summary(1/2)vDistributed systems consist of autonomous computers that work together to give the appearance of a single coherent system.One important advantage is that they make it easier to integrate different applications running on different computers into a single system.Another advantage is that when properly designed,distributed systems scale well with respect to the size of the underlying network.vDistributed systems often aim at hiding many of the intricacies related to the distribution of processes,data,and control.However,this distribution transparency not only comes at a performance price,but in practical situations it can never be fully achieved.The fact that trade-offs need to be made between achieving various forms of distribution transparency and can easily complicate their understanding.Summary(2/2)vMatters are further complicated by the fact that many developers initially make assumptions about the underlying network that are fundamentally wrong.Later,when assumptions are dropped,it may turn out to be difficult to mask unwanted behavior.Other pitfalls include assuming that the network is reliable,static,secure,and homogeneous.vDifferent types of distributed systems exist which can be classified as being oriented toward supporting computations,information processing,and pervasiveness.Distributed computing systems are typically deployed for high-performance applications often originating from the field of parallel computing.A huge class of distributed can be found in traditional office environments where we see databases playing an important role.Typically,transaction processing systems are deployed in these environments.Finally,an emerging class of distributed systems is where components are small and the system is composed in an ad hoc fashion,but most of all is no longer managed through a system administrator.
收藏