• Post Reply Bookmark Topic Watch Topic
  • New Topic

Performance Issues RMI vs SOAP

 
ahmad namini
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all:
I need some clarification regarding performance when comparing RMI to SOAP.
From my understanding, RMI should perform better because of the transport mechanism and better serialization.
Is that correct, and if not, please clarify.
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, an application designed in RMI is much faster than the one designed in SOAP. But if you are trying to create a new application think of using SOAP as its easy to code and maintain. Ofcourse, consider the speed requirements that you have. Its a bad idea to convert an existing RMI application to a SOAP application.
Any comments are appreciated,
Thanks,
Kiran Devaram
Kansas State University
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll second that and add a little more...
The only reason to use an RPC web service instead of RMI/IIOP would stem from the desire to have the functionality accessible to a wider variety of clients who may or may not be behind a firewall.
Not only is there more overhead due to the SOAP based marshalling/unmarshalling, but it makes it harder to deal with state. Your web service must be essentially stateless from a transaction perspective. If you needed to create a web service that was stateful, you could do it (...I have), but if you want to have a "transaction" that spans multiple calls to the service, you can't rely on the EJB container to handle it for you. You would need to write logic for compensatory transaction and even uglier, you'd need to deal with the issue of what happens if the web service client stops interacting with you mid transaction. There's no event model/call back mechanism to handle this sort of thing.
Keep in mind with EJB 2.0 you can get even more speed by making the interfaces local.
Now...
That being said, that is not to knock web services. I think they're great, but they are not necessarily the solution to every problem. I expect web services will be treated by some developers just like XML was. When XML became "hot" people wanted to use everywhere for everything whether it made sense or not. Web services is simply another tool, just like a hammer. I just wouldn't use it to drive in a screw. :-)
Regards,
 
ahmad namini
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!