Friday, January 11, 2008

Improve SOA Performance

SOA Applications Performance are disaster.

Lets assume you want to buy a book using SOA, this means you need to access several times a remote server using web service to complete the transaction, If you work with java then for each web service request you need to parse you java objects to XML objects send the request to the remote server on the other side the XML is parsed back to java objects it do it's stuff and then return a response parse it back to XML you get the XML and parse it back to java objects.

Lets assume that each of this horrible way takes 2 seconds, if you need to send 4 requests to complete the transaction it would take 8 seconds for one small transaction!!!

To improve the performance you would first need to set a well done granularity for your web services if it is possible, For example if to buy a book you first send a request to get the book name by book if and then you send a request with the book name to check if the book exists and then you send another request to buy the book, a better way would be to send one web service request which would do all of the above this would reduce the round trips between the client and the remote server, Instead of parsing XML files 2*3=6 times you would parse only 2 times.

A second way to improve the performance is to cache locally all the read only data which exists in the remote server, so instead of accessing the server using web service you would just read the data from the cache, You can also cache not read only data if you don't necessary need the last-to-update date.

Technical ways to improve the performance is to choose a good performance web service package, some packages take a lot of CPU/Memory to parse the XML to objects and vice-verse.

I recommend this SOA book to learn more:

1 comment:

Henrik Engström said...

I agree that designing the services with "correct" granularity is important, but SOA is so much more than just webservices.


RSS Feeds Submission Directory