Professional Documents
Culture Documents
Outline
The need RPC (Remote Procedure Call)
WebServices
Quick introduction Samples Advantages & disadvantages
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 publicly available. 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
Paradigm: The client process has to know the serving process and instantiates the communication. The client process calls a distant procedure and waits for the response (or fail).
5
RPC Samples
A simple server (part 1)
RPC Advantages
Advantages : Very simple logic and very low level, gives to the programmer a lot of freedom to implement different mechanisms on top of it. Can be implemented by any language (including C !). RPC exists since 1976, so its maturity and solidity are undoubted.
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
protocols.
10
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 powerful middleware layers, that would be able to provide us with :
OOP Load balancing
Failure detection/correction
Etc
11
12
is a Java application programming interface for performing 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-JVM context, a CORBA version was later developed. Uses HTTP or IIOP as communication layer.
13
RMI Samples
Here is a Server publishing a Hello Object
14
RMI Samples
Here is client invoking the previous Hello Object and
calling HelloFromServer() On it !
15
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
18
management down to much more limited services such as the furnishing of a stock quote.
19
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 your applications available to others as a Web service. Mashups (ex: Jogli.com)
20
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 than for toys like calculator. You can use cloud systems to easily scale.
engine. Amazon's Web Service - access Amazon's product information . XMethods - collection of information about existing Web services. Getting the last stock quote.
22
23
Recap
RPC Birth Platform Transport Dev Cost 1976 - 1981 Library and OSdependant OS-Dependent Huge RMI ~ 1990 Java HTTP or IIOP Reasonable Web Services ~ 2000 Independent HTTP(s) Low
Security
Overhead Dynamic invocation Versioning Service lookup
None
None None Huge problem Impossible
Client-level
OOP + HTTP Yes, using RDMI Possible using RDMI Java Naming and Directory
Transport Level
XML + HTTP Natural Natural UDDI
24
25