Raw socket vs CORBA vs XML-RPC vs SOAP
About the rush to web services.... People wanting performance may want to ponder the stats on this page:
Table 1. Results of the benchmarking applications
Technology Connect time Send string (21,000 characters) Receive string (22,000 characters) Send 5,000 integers Client LOC Server LOC Actual message size sending 1,000 characters Actual message size sending 100 integers Raw sockets 0.002242 0.001377 0.001359 6.740674 57 25 2,279 85,863 CORBA 0.000734 0.004601 0.002188 1.523799 37 18 2,090 27,181 XML-RPC 0.007040 0.082755 0.050199 100.337219 29 17 4,026 324,989 SOAP 0.000610 0.294198 0.279341 1,324.296742 32 10 4,705 380,288
Making the RPC mechanism human readable sure has helped. snicker. [Cincom Smalltalk Blog - Smalltalk with Rants]
Even when compared to XML-RPC, SOAP is just painfully slow by an order of magnitude. I wonder how much of it is due to XML-RPC's optimization for simplistic data? In XML-RPC most complicated data struct is array of basic types (roughly speaking) whereas SOAP is more geared towards serialization of arbitrary objects. Still XML-RPC is two order of magnitude behind CORBA.
The authors of the paper argue the poor performance of XML-RPC and SOAP are not significant for most applications and rising hardware performance compensates the lack of speed. Also commercial ORBs cost a fair amount. But most importantly "[XML-RPC and SOAP] are just based on plain XML. This means that if you support an in/outbound XML-based message structure in your application, no matter where the technology goes in the future, you will have a much easier time of moving your communications infrastructure to another format, as XML can be transformed into just about anything with a bit of XSLT." Here are my elaboration / spin of this quote or a few reasons to choose either XML-RPC or SOAP over CORBA:
- HTTP URL -- Having http://127.0.0.1/RPC2 allows you try out APIs interactively, visually using existing tools like browsers, wget, Python shell, etc. With CORBA, things are bit trickier. Also using webserver simplifies build, release, deployment, management, support and training for developers, QAs, release, IT, NOC, etc. Cost saving from this simplification would buy quite a few high-end ORBs.
- Data as XML -- two advantages: first, tools (again browser, XML editors, XSLT, etc) are available and secondly, keeping the data out of the code help organize the code more manageable. The second advantage is really the advantage of data independence, hence system modulization.
- Reasons 1 and 2 allow developers to build distributed application in a distributed manner. That is they can build components and subsystems piecemeal and make them connect via XML pipe one by one later. Also the cost of changing interface in XML is lower than changing the code stub and skeleton.
- Simple API -- Or rather CORBA's complexity is self-defeating.
- SOAP lets you choose between RPC and messaging programming models; it also lets you choose transport protocol eg HTTP, SMTP (really), MQ or JMS.
I am sure there are more and better reasons -- drop me a note please. Does anyone have similar test done with Java?
10:22:42 PM #
Copyright 2003 Jay Han
Theme Design by Bryan Bell