Wednesday, 27 April 2011

Domino data access - SOAP vs AMF3 - a live performance test...

OK, I believe it is clear that this test is all about receiving data from a Domino server in a non Notes Client using our data access API for Domino called soapgateQ!

But nevertheless I will provide some background:

soapgateQ! - as the name indicates - is a web service based generic data access API to the Lotus Notes Domino server. So soapgateQ! only talks SOAP. We have been interested on whether we will experience a performance gain, if we sort of plug a PHP server running AMFPHP in front of the Domino server.

So the test looks at 2 scenarios:
  1. A Flash/Air application talking to Domino via web services (SOAP)
  2. A Flash/Air application talking to a PHP server using AMF and the PHP server in turn talks to Domino using SOAP
Because of the reduced overhead using AMF, data is received much faster at the client. For the test we used a simple Notes database with 3.871 documents (rows), listed in a view with 2 columns. To test the performance we used the dbColumnX() web service operation provided by soapgateQ. This operation returns any requested  column, plus another 2 columns (noteID/UNID and the view entry number). Hence for this test we receive in total 4 columns of data or in technical terms an array of strings with 15.484 elements (as web services only support single dimensioned arrays). Using SOAP (1) the received data amounts to  ~ 531.859 Bytes, whilst using AMF (2) this amount is reduced to ~155.633 Bytes.

I believe the below table speaks for itself:

Server Upload Speeds
SOAP
AMF3
GSM (14,4 Kbit/s)
ca. 309.074ms
ca. 91.830ms
GPRS (53,6 Kbit/s)
ca. 86.871ms
ca. 25.901ms
UMTS (348 Kbit/s)
ca. 21.267ms
ca. 6.759ms
DSL 1000 (1024 Kbit/s)
ca. 13.125ms
ca. 4.952ms
HSPA (7327 Kbit/s)
ca. 10.447ms
ca. 4.766ms
DSL 16000 (16000 Kbit/s)
ca. 10.189ms
ca. 4.385ms


Here is a link to the live application:

2 comments:

  1. have you tried returning JSON instead of XML from Domino? This provides you with similar performance enhancement without an extra server.
    see:
    http://ekrantz.com/index.php/2007/03/02/faster-ajax-with-domino-and-json.html
    and
    http://ekrantz.com/index.php/2007/05/21/faster-ajax-with-domino-and-json-update.html

    Yes those are from 2007, and Domino supports JSON as of version 7.0.2

    ReplyDelete
  2. Lars, thanks for your posting, and yes, soapgateQ! supports the return of JSON for some of its operations.

    However, as we are talking Domino web services here, there is no such thing as "native JSON" support - SOAP is XML. So you can generate you own JSON and wrap it with SOAP. That is what we are doing.

    In other words, using "var sURL = './Docs?ReadViewEntries&count=1000&outputformat=json';" is not what we are doing and is not where we plan to go. We leave this turf to IBM.

    Flex/Flash also has no native JSON support (as far as I know). There are open source JSON to AS3 Object decoders (which in matter of fact we use in our Flex libraries), but that means the performance gain you have reducing the size of data transfered is lost in the decoding of the latter.

    If you utilise soapgateQ! in any Java development (perfectly possible and feasible), returning JSON would of course deliver similar performance gains as the once we experienced using AFMPHP.

    ReplyDelete