Analysis of different middleware implementation techniques for Service oriented architecture

computerharpySoftware and s/w Development

Dec 2, 2013 (3 years and 10 months ago)

87 views

Analysis of different middleware
implementation techniques for
Service
oriented architecture


Guided By : Dr. S.R.Devane

Presented by : Aparna Kale

Overview


Introduction


Find
-
Bind
-
Execute paradigm in SOA


Middleware in SOA


Ways of implementing middleware in SOA


Middleware technologies :Web Services
and RMI ,RMI tunneling techniques


Performance comparison


Overhead Analysis


Conclusion



Service Oriented Architecture


A model of designing ,developing deploying and
maintaining discrete units of logic i.e. services within
a computing environment.



Business logic or individual functions are presented as
services for consumer applications.


Separates the application of service and its
implementation.


The goal is to achieve flexibility, reusability and
interoperability

Consumer Application using Web Services


Service

consumer
:



requires

a

service
.



Initiates

the

enquiry

of

the

service

in

the

registry,



binds

to

the

service

over

a

transport,

and

executes

the

service

function
.



Service
Consume
r

Service

Provider

Service
Registry

Service

Description

Service

Description

Service

Find

Bind and
Execute

Publish


Service

provider
:




network
-
addressable

entity



Publishes

its

services

to

the

service

registry


Service

registry
:


Helps

in

service

discovery
.


repository

of

available

services

and

allows

for

the

lookup


SOA collaborations :Find

Bind
-
Invoke

Components in SOA


Service Consumers and
Service providers
communicate via a
common communication
framework called a “service
bus”.


Typically, called
middleware programs

that provide messaging
services so that different
applications can
communicate.



Middleware technology for SOA


For realizing service bus component in SOA
middleware alternatives on java platform are


Web Services.


Remote Method Invocation (RMI).


RMI tunneling techniques


HTTP
-
to
-
PORT.


HTTP
-
to CGI.


Web Service :

The General Process of Engaging a Web Service

Web Services Using Java Platform

Web Services
Provider

Web Services
Directory

Web Services
Client

1.
Publish

JAXR

2.Discover

JAXR

3.Bind and Invoke

JAX
-
RPC


JAXR : Java APIs to access a variety of Xml Registries like UDDI and ebXML
registries



JAX
-
RPC :Java API for XML based RPC. This is an API for building and deploying
SOAP +WSDL web services clients and provider

Web Services


Drawback:



No support for object oriented references.



Absence of distributed garbage collection.


SOAP protocol (XML based) might lower the
performance of web services.

RMI Layers:

TCP

Remote Reference Layer

Transport Layer

Java Virtual Machine

Remote Object


Skeleton

Remote Reference Layer

Transport Layer

Java Virtual Machine

Stub

Client
Object

Copyright © 1997 Alex Chaffee

RMI System Architecture

Client Virtual Machine

Client

Server Virtual Machine

Stub

Remote
Object

Skeleton

Registry Virtual Machine

“Fred”


Server

1

2

1. Server Creates Remote Object

2. Server Registers Remote Object

Copyright © 1997 Alex Chaffee

RMI System Architecture

Client Virtual Machine

Client

Server Virtual Machine

Stub

Remote
Object

Skeleton

Registry Virtual Machine

“Fred”


Server

4

3. Client requests object from Registry

4. Registry returns remote reference

(and stub gets created)

3

Copyright © 1997 Alex Chaffee

RMI System Architecture

Client Virtual Machine

Client

Server Virtual Machine

Stub

Remote
Object

Skeleton

Registry Virtual Machine

“Fred”


Server

6

5. Client invokes stub method

6. Stub talks to skeleton

7. Skeleton invokes remote object


method

5

7

Drawbacks


Firewall blocks communication between the client
and the server.


Firewall block access to RMI registry running on part
1099 (default port)


Direct access to RMI server is blocked if it is not
running on port 80 or 443


Difficult when connectivity and interoperability over
different LANS each having its on firewall.


For ex: e
-
business applications which require
integration between enterprises

RMI Tunneling Techniques


Tunneling

is a

technology that enables one
network to send its data via another network's
connections.


RMI tunneling can be done in 2 ways


Allows communication to the server’s host using
HTTP POST request.


Allows communication to server’s host using standard
port 80

RMI Tunneling Techniques


HTTP to Port



Use HTTP POST request to Servers
Skeleton.



HTTP to CGI / Servlet :



Use the standard HTTP port 80,


Using a CGI script or Servlets that will forward
the posted RMI request to the server.


HTTP

to
-

Port Tunneling



Used in a situation where there is HTTP proxy
between client and server.



Two ways to implement HTTP to port tunneling


Use Java RMI automatic fallback functionality


Force RMI to use HTTP to port tunneling by setting
RMISocketFactory to RMIHttpToPortSocketFactory.


HTTP

to
-

Port Tunneling


Figure : Sequence diagram for HTTP
-
to
-
Port Tunneling

HTTP
-
to
-
CGI /servlet tunneling


CGI script or servlet capable of redirecting a
request to designated port is used.


Two ways of implementation:


Automatic fall back by providing address of web
server instead of HTTP proxy server.


Set RMI factory to RMIHTTPtoCgiSocketFactory.


HTTP
-
to
-
CGI /servlet tunneling

Figure : Sequence diagram for HTTP
-
to
-
CGI/Servlet tunneling [3].

Performance Comparison


Comparison between Web Services, RMI and
RMI Tunneling Techniques


Evaluation Based On :



Round trip method invocation time for
different data types.


Instantiation time


Round trip method invocation time for String
data type.


Performance Comparison Without
Network Overhead


For instantiation web services are
faster than RMI by approximately
10%.



For basic data types RMI is faster
than web services by approximately
15 times.



Http
-
To
-
Port is 32 times slower
than RMI and 2 times slower than
web services.


RMI

HTTP
-
to
-
Port

Http
-
to
-
Servlet

Web Services

Instantiation

Simple type
Average

String

Performance Comparison With
Network Overhead

RMI

HTTP
-
to
-
Port

Http
-
to
-
Servlet

Web Services

Instantiation

Simple type
Average

String


Web services are approximately
8.8 times slower for average basic
data types than RMI



web services are approximately
8.5 times slower for string data types
than RMI



HTTP
-
to
-
servlet and web services
performance improved in network
connection due to load distribution.


Relative Comparison with RMI

Instantiation

Simple Type
Average

String

Factor Compared to RMI


HTTP
-
to
-

servlet is
second fastest alternative,
approximately 3.2 times
slower than Web services.



HTTP
-
to
-
port 4 times
slower than web services.



Overhead analysis:



Performance difference is related to
message
protocol used for communication .


Binary protocol and Xml based protocol.


Binary serialization and Xml serialization


Lookup and Invocation


slower performance of RMI tunneling
techniques :


Lot of communication related to fall back and
routing /forwarding of request


Additional marshaling /demarshaling costs
related to creation of HTTP POST request


Impact on Application design and
Implementation


Distributed models hide the complexity of remote
communication from developer
.



The remote method invocation can be improved by


interface design,


amount of data transferred over the wire,


message structure and their overhead,


state management,


serialization performance,


message processing and encoding.

To Minimize remote invocation
Using RMI


Use of coarse
-
grained interfaces,


V
alue objects with only necessary state (set
of attributes and relations),



For complex objects custom methods to read
and write the state of the object will be more
efficient



Preinstalling the necessary classes

for
Serialization


RMI value objects with methods for input
validation


Optimization :


Fast and flexible marshaling algorithms


SOAP overhead related to marshaling can be
reduced with parser optimization


Instantiation overhead can be minimized with
the introduction of instance and connection
pooling .


Conclusion


Transition to RMI tunneling is relatively administrative
tasks including configuration of tunneling components
and settings.


RMI tunneling offers poor performance as compared
to RMI.


Transition to web services is related to development
efforts.


For performance sensitive distributed applications if
ports for RMI communication cannot be opened ,web
services offer better performance.


References :


Web services and JAVA middleware functional and performance analysis for
SOA by Matjaz B.Jurie,Marjan Hericko,Ivan Rozman, Ana Sasa, 2007 IEEE
international conference on digital ecosystems and technologies .




Comparison

of

performance

of

Web

services

,RMI,RMI
-
SSL

by

Matjaz

B
.
Jurie,Marjan

Hericko,Ivan

Rozman,

Ana

Sasa,

The

Journal

of

systems

and

software

79
(
2006
)

689
-
700
,www
.
elsevier
.
com/locate/jss
.