mc714 sistemas distribu dos
play

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de - PowerPoint PPT Presentation

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de Computac ao, Unicamp Aula 2: Arquiteturas de sistemas distribu dos Revision: Distribution Transparency Transp. Description Access Hide differences in data


  1. MC714: Sistemas Distribu´ ıdos Prof. Lucas Wanner Instituto de Computac ¸ ˜ ao, Unicamp Aula 2: Arquiteturas de sistemas distribu´ ıdos

  2. Revision: Distribution Transparency Transp. Description Access Hide differences in data representation and invocation mechanisms 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 failure and possible recovery of an object Note Distribution transparency is a nice a goal, but achieving it is a different story. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 2 / 30

  3. Revision: Techniques for Scaling Hide communication latencies Avoid waiting for responses; do something else: Make use of asynchronous communication Have separate handler for incoming response Problem: not every application fits this model Distribution Partition data and computations across multiple machines: Move computations to clients (Java applets) Decentralized naming services (DNS) Decentralized information systems (WWW) Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 3 / 30

  4. Revision: Techniques for Scaling Replication/caching Make copies of data available at different machines: Replicated file servers and databases Mirrored Web sites Web caches (in browsers and proxies) File caching (at server and client) Observation 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. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 4 / 30

  5. Revision: Transactions Model A transaction is a collection of operations on the state of an object (database, object composition, etc.) that satisfies the following properties (ACID) Atomicity: All operations either succeed, or all of them fail. When the transaction fails, the state of the object will remain unaffected by the transaction. Consistency: A transaction establishes a valid state transition. This does not exclude the possibility of invalid, intermediate states during the transaction’s execution. Isolation: Concurrent transactions do not interfere with each other. It appears to each transaction T that other transactions occur either before T , or after T , but never both. Durability: After the execution of a transaction, its effects are made permanent: changes to the state survive failures. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 5 / 30

  6. Revis˜ ao: Exerc´ ıcios Defina e compare sistemas distribu´ ıdos e sistemas paralelos. 1 Qual ´ e o papel de um middleware em sistemas distribu´ ıdos? 2 Dˆ e exemplos e defina diferentes tipos de transparˆ encia de distribuic ¸ ˜ ao. 3 Qual ´ e a diferenc ¸a entre transparˆ encia de migrac ¸ ˜ ao e transparˆ encia de relocac ¸ ˜ ao? 4 Defina escalabilidade. Quais t´ ecnicas s˜ ao usadas para atingir escalabilidade? 5 Qual ´ e a diferenc ¸a entre replicac ¸ ˜ ao e caching? 6 A vis˜ ao tradicional de transac ¸ ˜ oes diz que quando uma transac ¸ ˜ ao ´ e abortada, ´ e como 7 se a transac ¸ ˜ ao nunca tivesse acontecido. Dˆ e um exemplo onde isto n˜ ao ´ e verdade. Qual ´ e o papel de um coordenador de transac ¸ ˜ oes? 8 6 / 30

  7. Programa T´ opico Cap´ ıtulo Introduc ¸ ˜ ao e Fundamentos 1 Arquituras de sistemas distribu´ ıdos 2 Processos e Threads Revis˜ ao, 3 Clientes/Servidores, Virtualizac ¸ ˜ ao e N´ uvem 3 Comunicac ¸ ˜ ao: Revis˜ ao, Sockets Revis˜ ao, 4 Troca de Mensagens, Multicast 4 Disseminac ¸ ˜ ao de informac ¸ ˜ ao 4 Remote Procedure Call 4 Nomeac ¸ ˜ ao 5 Sincronizac ¸ ˜ ao de rel´ ogio 6 Rel´ ogios L´ ogicos 6 Exclus˜ ao m´ utua 6 Eleic ¸ ˜ ao de l´ ıder 6 7 / 30

  8. Exerc´ ıcios Se um cliente e um servidor est˜ ao afastados, a latˆ encia de rede pode dominar o 1 desempenho. Como podemos tratar este problema? Qual ´ e a diferenc ¸a entre distribuic ¸ ˜ ao horizontal e vertical? 2 Considere um sistema distribu´ ıdo verticalmente em n processos P 1 , P 2 ,..., P n . O 3 processo P i ´ e cliente do processo P i + 1 , e P i retorna uma resposta para P i − 1 somente ap´ os receber uma resposta de P i + 1 . Quais s˜ ao os fatores limitantes do desempenho do processo P 1 ? Dˆ e um exemplo de uso de um interceptador em um middleware. 4 Carros modernos s˜ ao equipados com m´ ultiplos componentes eletrˆ onicos. Dˆ e 5 exemplos de controle por feedback em carros. 8 / 30

  9. Exerc´ ıcios Considere uma rede de overlay com N n´ os em que cada n´ o seleciona c vizinhos 4 aleatoriamente. Se P e Q s˜ ao vizinhos de R , qual ´ e a probabilidade de serem vizinhos entre si? 1 Para procurar um arquivo, um n´ o envia um pedido por inundac ¸ ˜ ao para todos os seus 2 vizinhos, e solicita que estes enviem o pedido para os seus respectivos vizinhos mais uma vez. Dˆ e um limite superior para o n´ umero de n´ os que ser˜ ao alcanc ¸ados. Considere um sistema BitTorrent onde cada n´ o tem capacidade de sa´ ıda B out , e 5 capacidade de entrada B in , com B in > B out . Alguns n´ os (chamados seeds ) oferecem arquivos para download por outros n´ os. Considere que h´ a S seeds e N clientes. Qual ´ e a capacidade m´ axima de download de um cliente: Se cada cliente pode contactar somente um seed por vez? 1 Se, al´ em dos seeds, os clientes podem trocar pedac ¸os de arquivos ( chunks ) entre si, 2 com uma taxa 1:1 de entrada:sa´ ıda? 9 / 30

  10. Architectures Architectural styles Software architectures Architectures versus middleware Self-management in distributed systems Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 10 / 30

  11. Architectural styles Basic idea Organize into logically different components, and distribute those components over the various machines. Layer N Object Object Layer N-1 Object Method call Request� Response� flow flow Object Layer 2 Object Layer 1 (a) (b) (a) Layered style is used for client-server system (b) Object-based style for distributed object systems. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 11 / 30

  12. Architectural Styles Observation Decoupling processes in space (“anonymous”, referential coupling) and also time (“asynchronous”) has led to alternative styles. Component Component Component Component Event delivery Publish Data delivery Event bus Publish Shared (persistent) data space Component (b) (a) (a) Publish/subscribe [decoupled in space] (b) Shared dataspace [decoupled in space and time] Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 12 / 30

  13. Centralized Architectures Basic Client–Server Model Characteristics: There are processes offering services (servers) There are processes that use services (clients) Clients and servers can be on different machines Clients follow request/reply model wrt to using services Wait for result Client Request Reply Server Provide service Time Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 13 / 30

  14. Application Layering Traditional three-layered view User-interface layer contains units for an application’s user interface Processing layer contains the functions of an application, i.e. without specific data Data layer contains the data that a client wants to manipulate through the application components Observation This layering is found in many distributed information systems, using traditional database technology and accompanying applications. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 14 / 30

  15. Example of a three-tiered architecture 15 / 30

  16. Application Layering User-interface User interface level HTML page containing list Keyword expression HTML generator Processing Query level Ranked list generator of page titles Ranking algorithm Database queries Web page titles with meta-information Data level Database with Web pages Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 16 / 30

  17. Multi-Tiered Architectures Single-tiered: dumb terminal/mainframe configuration Two-tiered: client/single server configuration Three-tiered: each layer on separate machine Traditional two-tiered configurations: Client machine User interface User interface User interface User interface User interface Application Application Application Database User interface Application Application Application Database Database Database Database Database Server machine (a) (b) (c) (d) (e) Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 17 / 30

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend