Comparison Between Rpc Rmi and Webservices

Embed Size (px)

Citation preview

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    1/25

    ByJihed Othmani

    Jing WangKarim Jouini

    Mathieu Martin

    1

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    2/25

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    3/25

    The Need More and more devices are connected, tempting us to

    take advantage of their computational capabilities.

    We would like to communicate, reuse code, share

    services. There are a lot of opportunities to leverage services

    offered by others and to make your application publiclyavailable.

    Provide a service without sharing code. So : we need a standardization of protocols to ease

    communication at the application layer. Thats what we call middlewares.

    3

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    4/25

    4

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    5/25

    RPC

    Quick Introduction First system to addressthe need to communicate

    across process and machines boundaries.

    RPC was first described in 1976 by the RFC707.

    Xerox used RPC in the popular software courier, 1981.

    Paradigm:

    The client process has to know the serving process andinstantiates the communication.

    The client process calls a distant procedure and waits forthe response (or fail).

    5

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    6/25

    RPC

    SamplesA simple server (part 1)

    6

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    7/25

    A simple server (part 2)

    7

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    8/25

    A simple client using our previous server

    8

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    9/25

    RPC

    AdvantagesAdvantages :

    Very simple logic and very low level, gives to theprogrammer a lot of freedom to implement differentmechanisms on top of it.

    Can be implemented by any language (including C !).

    RPC exists since 1976, so its maturity and solidity areundoubted.

    9

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    10/25

    RPC

    Disadvantages Using RPC can become very complex

    The complexity is exposed as the number of procedures Interaction with such a module requires using all these

    interfaces in the right way and sequence. A lot of code is needed for even simple applications. RPC gives no answer to fundamental questions:

    How to find peers ? How to distribute the workload over multiple servers? How failure and recovery should be handled? How to send/receive complex data structures. Security? Sasser, blaster, etc Are RPC-vulnerability exploits

    There are multiple different and incompatible RPCprotocols.

    10

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    11/25

    RPC

    Future ? RPC is way too complex to be used as middleware in

    modern software.

    RPC can be used as low level layer for more powerfulmiddleware layers, that would be able to provide uswith :

    OOP

    Load balancing Failure detection/correction

    Etc

    11

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    12/25

    12

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    13/25

    RMI

    Quick Introduction The Java Remote Method Invocation API, or Java RMI,

    is a Java application programming interface forperforming the object equivalent of Remote Procedure

    Calls.

    There are two common implementations of the API. Java Remote Method Protocol (JRMP)

    In order to support servers running in a non-JVMcontext, a CORBA version was later developed.

    Uses HTTP or IIOP as communication layer.

    13

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    14/25

    RMI

    Samples Here is a Server publishing a Hello Object

    14

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    15/25

    RMI

    Samples Here is client invoking the previous Hello Object and

    calling HelloFromServer() On it !

    15

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    16/25

    RMI

    Advantages & disadvantagesAdvantages

    Java, so portable and Oriented Object.

    NAT-Firewall traversal capabilities. Asynchronous possibilities with ARMI (Async-RMI).

    Easier to use and setup than CORBA.

    RDMI enables dynamic invocation.

    First attempt to address security. Latest versions are CORBA-compatible (using IIOP).

    Disadvantages

    Java only

    16

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    17/25

    RMI

    Future ? RMI still needs to find answers to:

    How to implement real server-level security ?

    How to perform load balancing ? How to use RMI in other languages ?

    17

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    18/25

    18

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    19/25

    Web Services

    Quick IntroductionA software system designed to support interoperable

    machine-to-machine interaction over a network.

    It refers to clients and servers that communicate overthe HTTP protocol used on the Web.

    Web services range from such major services as storagemanagement down to much more limited servicessuch as the furnishing of a stock quote.

    19

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    20/25

    Web Services

    Advantages Universal Support. Protocol not Platform. Low Product Costs. Evolutionary thanks to XML.

    Business Oriented. The standardized nature of the pieces that implement a Web service solves

    many problems related to intersystem communication. For example: The HTTP standard allows more systems to communicate with one another. SOAP (built on XML) standardizes the messaging capability on different systems. UDDI standardizes the publishing and finding of Web services. WSDL standardizes the description of Web services, so providers and requesters speak

    the same language.

    Opportunities to take advantage of services offered by others and to make yourapplications available to others as a Web service. Mashups (ex: Jogli.com)

    20

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    21/25

    Web Services

    Disadvantages No security standards: Web services are exposed to the public

    using http-based protocols. Adopting open security standards like SSL or XML-encryption may

    be a solution.

    Processing time and data traffic costs are significantly higher Very verbose : Multiplication of the conveyed information mass.

    But: To buy a faster CPU is cheaper than employing a programmer and

    systems administrator capable of handling RMI.

    Performance differences less marked for more realistic applications thanfor toys like calculator.

    You can use cloud systems to easily scale.

    No load balancing at the protocol level.

    21

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    22/25

    Web Services

    Samples Google's Web Service - access the Google search

    engine.

    Amazon's Web Service - access Amazon's productinformation .

    XMethods - collection of information about existingWeb services.

    Getting the last stock quote.

    22

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    23/25

    23

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    24/25

    Recap

    24

    RPC RMI Web Services

    Birth 1976 - 1981 ~ 1990 ~ 2000

    Platform Library and OS-dependant

    Java Independent

    Transport OS-Dependent HTTP or IIOP HTTP(s)

    Dev Cost Huge Reasonable Low

    Security None Client-level Transport Level

    Overhead None OOP + HTTP XML + HTTP

    Dynamic invocation None Yes, using RDMI Natural

    Versioning Huge problem Possible usingRDMI

    Natural

    Service lookup Impossible Java Naming andDirectory

    UDDI

  • 8/13/2019 Comparison Between Rpc Rmi and Webservices

    25/25

    25