1 / 54

Distributed Systems

Distributed Systems. Docent : Vincent Naessens. Chapter 10: distributed object-based systems. Chapter 10: distributed object-based systems. 10.1. Architecture 10.2. Processes 10.3. Communication. 10.1. Architecture. Distributed objects Client stub  proxy Server stub  skeleton

yank
Télécharger la présentation

Distributed Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Systems Docent: Vincent Naessens

  2. Chapter 10:distributed object-based systems

  3. Chapter 10: distributed object-based systems • 10.1. Architecture • 10.2. Processes • 10.3. Communication

  4. 10.1. Architecture • Distributed objects • Client stub  proxy • Server stub  skeleton • State is not distributed!! (also called remote objects)

  5. 10.1. Architecture • Compile-time versus runtime objects • Compile-time objects • Object = instance of a class • Compilation of interfaces into client and server stubs • Neg: dependency on particular programming language • Run-time objects • Object = definition of an interface • Object implementation can be in any language • Object adapters act as a wrapper around the implementation

  6. 10.1. Architecture • Persistent versus transient objects • Persistent object: • lifetime can be larger than lifetime of server • Transient object: • lifetime cannot be larger than lifetime of server

  7. 10.1. Architecture • Enterprise Java Beans • Language + runtime support for distributed objects • EJB = Java object that is hosted by a special server offering different ways for remote clients to invoke that object • Application oriented functionality  EJB • System oriented functionality  JMS, JNDI, JDBC, RMI • EJB embedded in a container • Providers interfaces for underlying services

  8. 10.1. Architecture • Enterprise Java Beans (4 types) • Stateless session beans • Handling SQL query • Stateful session beans • Shopping cart • Entity beans • Long-live & persistent • Message-driven beans • React on messages

  9. 10.1. Architecture • Enterprise Java Beans (short tutorial – see SUN)

  10. 10.1. Architecture • Enterprise Java Beans (short tutorial – see SUN) • Step 1: install Enterprise JavaBeans Server • Step 2: specify the Enterprise JavaBeans Remote Interface • contains interfaces for application logic public interface Demo extends EJBObject, Remote • Step 3: specify the Home Interface • contains interface for creation of EJB public interface DemoHome extends EJBHome • Step 4: write the EJB class • contains implementation of application logic • Implements EJB remote interface public class DemoBean implements SessionBean

  11. 10.1. Architecture • Enterprise Java Beans (short tutorial – see SUN) • Step 5: create ejb-jar file • Compile .java files (Demo, DemoHome, DemoBean) • Create deployment description DemoBeanDD.ser • Create a Manifest • Create a .jar file containing the files • Step 6: deploy the DemoBean Enterprise JavaBeans • Put the bean in a container at the server • Step 7: write the Enterprise JavaBean Client • Locate the demo.DemoHome • Create the EJB at the server using DemoHome • Call application methods on the DemoBean • Step 8: run the client

  12. 10.2.Processes • Object servers • Designed to host distributed objects • Does not provide a specific service itself • Concerns of an object server • Which code to execute? • On which data to operate? • Starting a seperate thread? • Alternatives for invoking objects • 1 policy for each invocation • Different policies depending on object types

  13. 10.2.Processes • Object servers • Different activation policies • Storing transient objects in RAM and destroy it as soon as no clients are bound • Ex: calculator • Storing each object (data + code) invocation call in a seperate memory segment • Ex: for security reasons • Different threading policies • 1 server thread • 1 thread per object • automatic protection against concurrent access  • 1 thread per invocation • Increases concurrency 

  14. 10.2.Processes • Object adaptor • Groups objects per policy • 1 or more objects under control • Unaware of appl. interfaces • Example: • Decides when to destroy object • Generates object identifiers • Single-threaded versus multi-threaded

  15. 10.3. Communication • Binding a client to an object • Implicit binding (a) versusexplicit binding (b)

  16. 10.3. Communication • Implementation of object references • An object reference must contain enough information to allow a client to bind to an object • Reference can contain • Network address of machine • Server port that manages object • Indication of object

  17. 10.3. Communication • Implementation of object references • Disadvantages: • Server cannot be run on different port • Solution: daemon that manages servers on machine • Server cannot be run on different machine • Solution: location server keeps track of object locations • Object reference then keeps: • Address of location server • A systemwide identifier of server

  18. 10.3. Communication • Implementation of object references • Adding additional information (such as marshalling protocol): • Including in object reference • Making an implementation handle available at a site

  19. 10.3. Communication • Static versus dynamic remote method invocations • Static invocation • Object interfaces are known when client is developed • Recompilation of client if object interface changes • Ex: fobject.append(x) • Dynamic invocation • Select at runtime the method that is invoked • invoke(object,method,input_params,output_params) • Ex: invoke(fobject,id(append),x)

  20. 10.3. Communication • Parameter passing • Local objects  a copy is sent to the server (O1) • Remote objects  reference to object is sent to server (O2)

  21. 10.3. Communication • Example: Java RMI • Cloning an object can only be done at the server • Clients cannot clone a remote object • Only serializable objects can be cloned • Parameter passing • Local objects are passed by value • Remote objects are passed by reference • Reference of remote object consists of • (address, server endpoint, local identifier) • Encode protocol stack

  22. 10.3. Communication • Example: Java RMI • Proxies are serializable • Can be sent to other processes • Implementation handles are generated to pass code • Proxy code can be dowloaded separately • More efficient than marshalling the code itself • Note that the object state is still marshalled

  23. 10.3. Communication • Object-based messaging • CORBA supports asychronous method invocation • Strategy 1: callback model • Server interface • int add(in int i, in int j, out int k) • Client interfaces • void sendcb_add(in int i, in int j) • void replycb_add(in int ret_val, in int k) • Last one needs to be implemented by client

  24. 10.3. Communication • Object-based messaging • CORBA supports asychronous method invocation • Strategy 1: callback model

  25. 10.3. Communication • Object-based messaging • CORBA supports asychronous method invocation • Strategy 2: polling model • Server interface • int add(in int i, in int j, out int k) • Client interfaces • void sendpoll_add(in int i, in int j) • void replypoll_add(out int ret_val, out int k) • Called by application

  26. 10.3. Communication • Object-based messaging • CORBA supports asychronous method invocation • Strategy 2: polling model

  27. Chapter 11:Distributed File Systems

  28. Chapter 11: distributed file systems • 11.1. Architecture

  29. 11.1. Architecture • Client-server architectures • Network File System is prototypical example • Each NFS server provides a standardized view on its local file system • Communication protocol that allows file retrieval • Two file server models • Model (a): Remote access model (like NFS) • Model (b): upload download model (like FTP)

  30. 11.1. Architecture • NFC architecture

  31. 11.1. Architecture • More detailed info about NFC • See course on system administration

  32. Hoofdstuk 12:Distributed web-based systems

  33. Chapter 12: distributed web-based systems • 12.1. Architecture • 12.2. Processes • 12.3. Communication • 12.6. Consistency and replication

  34. 12.1. Architecture • Traditional web-based systems

  35. 12.1. Architecture • Traditional web-based systems • Main part is written in a markup-language • HTML or XML • Second part consists of embedded documents • MIME type is associated to each embedded document • Top-level types: text, image, video, application... • Subtypes: gif, jpeg, ... • Special note on “application types” • Some are run in separate program • Some are offered as a seperate plugin

  36. 12.1. Architecture • Traditional web-based systems • Overview of certain MIME types

  37. 12.1. Architecture • Traditional web-based systems • Multitiered architectures • CGI extensions • user passes CGI-name +parameters • CGI script is executed at server AND document is returned

  38. 12.1. Architecture • Web services • Examples: weather reporting service, naming service, electronic supplier, ... • Standardization in • How services are described • How services are looked up • UDDI = Universal Description, Discovery and Integration standard • WSDL = Web Services Definition Language • Some kind of IDL • SOAP = Simple Object Access Protocol • Standardization of communication between processes

  39. 12.1. Architecture • Web services

  40. 12.1. Architecture • Web services • Web services composition • Bookstore consists of multiple providers • Book order service • payment service • delivery service • Web services coordination • Standardization of coordination protocols • Single coordinator versus distributed coordination • Standardisation of web services coordination

  41. 12.2. Processes • Logical components of a web browser

  42. 12.2. Processes • Web proxy if browser does not speak FTP • Example: Squid • Today: integrated in many browsers

  43. 12.2. Processes • The Apache Web server • Extensible and flexible • Hook = specific set of functions • Hook 1: translate URL to local file name • Hook 2: writing information to a log • Hook 3: checking access rights • ...

  44. 12.2. Processes • The Apache Web server

  45. 12.2. Processes • Web server clusters • Replication of servers to enhance performance • Front end redirects client requests • Type 1: front-end at TCP layer • Forwarding HTTP requests/responses • communication bottleneck • TCP handoff • Solves communication bottleneck • Disadvantage: • Decisions are based on load, not on contents of requests

  46. 12.2. Processes • Web server clusters • Type 1: front-end at TCP layer

  47. 12.2. Processes • Web server clusters • Replication of servers to enhance performance • Front end redirects client requests • Type 2:Content-aware request distribution • Disadvantage: no TCP handoff possible • Type 3: hybrid architecture • See figure on next slide

  48. 12.2. Processes • Web server clusters • Type 3: hybrid architecture

  49. 12.3. Communication • Hypertext Transfer Protocol • Nonpersistent (HTTP1.0) (a) versus persistent connections (HTTP1.1) (b)

  50. 12.3. Communication • Hypertext Transfer Protocol • Operations • Request and response headers

More Related