Latest News

    • Web Services Architecture – When to Use SOAP vs REST

      SOAP (Simple Object Access Protocol) and REST (Representation State Transfer) are popular with developers working on system integration based projects. Software architects will design the application from various perspectives and also decides, based on various reasons, which approach to take to expose new API to third party applications. As a software architect, it is good practice to involve your development team lead during system architecture process.   This article, based on my experience, will discuss when to use SOAP or REST web services to expose your API to third party clients.   Web Services Demystified Web services are part of the Services Oriented Architecture. Web services are used as the model for process decomposition and assembly. I have been involved in discussion where there were some misconception between web services and web API.   The W3C defines a Web Service generally as:   A software system designed to support interoperable machine-to-machine interaction over a network.   Web API also known as Server-Side Web API is a programmatic interface to a defined request-response message system, typically expressed in JSON or XML, which is exposed via the web – most commonly by means of an HTTP-based web server. (extracted from Wikipedia)   Based on the above definition, one can insinuate when SOAP should be used instead of REST and vice-versa but it is not as simple as it looks. We can agree that Web Services are not the same as Web API. Accessing an image over the web is not calling a web service but retrieving a web resources using is Universal Resource Identifier. HTML has a well-defined standard approach to serving resources to clients and does not require the use of web service in order to fulfill their request.   Why Use REST over SOAP Developers are passionate people. Let's briefly analyze some of the reasons they mentioned when considering REST over SOAP:   REST is easier than SOAP I'm not sure what developers refer to when they argue that REST is easier than SOAP. Based on my experience, depending on the requirement, developing REST services can quickly become very complex just as any other SOA projects. What is your service abstracting from the client? What is the level of security required? Is your service a long running asynchronous process? And many other requirements will increase the level of complexity. Testability: apparently it easier to test RESTFul web services than their SOAP counter parts. This is only partially true; for simple REST services, developers only have to point their browser to the service endpoints and a result would be returned in the response. But what happens once you need to add the HTTP headers and passing of tokens, parameters validation… This is still testable but chances are you will require a plugin for your browser in order to test those features. If a plugin is required then the ease of testing is exactly the same as using SOAPUI for testing SOAP based services.   RESTFul Web Services serves JSON that is faster to parse than XML This so called "benefit" is related to consuming web services in a browser. RESTFul web services can also serve XML and any MIME type that you desire. This article is not focused on discussing JSON vs XML; and I wouldn't write any separate article on the topic. JSON relates to JavaScript and as JS is very closed to the web, as in providing interaction on the web with HTML and CSS, most developers automatically assumes that it also linked to interacting with RESTFul web services. If you didn't know before, I'm sure that you can guess that RESTFul web services are language agnostic. Regarding the speed in processing the XML markup as opposed to JSON, a performance test conducted by David Lead, Lead Engineer at MarkLogic Inc, find out to be a myth.   REST is built for the Web Well this is true according to Roy Fielding dissertation; after all he is credited with the creation of REST style architecture. REST, unlike SOAP, uses the underlying technology for transport and communication between clients and servers. The architecture style is optimized for the modern web architecture. The web has outgrown is initial requirements and this can be seen through HTML5 and web sockets standardization. The web has become a platform on its own right, maybe WebOS. Some applications will require server-side state saving such as financial applications to e-commerce.   Caching When using REST over HTTP, it will utilize the features available in HTTP such as caching, security in terms of TLS and authentication. Architects know that dynamic resources should not be cached. Let's discuss this with an example; we have a RESTFul web service to serve us some stock quotes when provided with a stock ticker. Stock quotes changes per milliseconds, if we make a request for BARC (Barclays Bank), there is a chance that the quote that we have receive a minute ago would be different in two minutes. This shows that we cannot always use the caching features implemented in the protocol. HTTP Caching be useful in client requests of static content but if the caching feature of HTTP is not enough for your requirements, then you should also evaluate SOAP as you will be building your own cache either way not relying on the protocol.   HTTP Verb Binding HTTP verb binding is supposedly a feature worth discussing when comparing REST vs SOAP. Much of public facing API referred to as RESTFul are more REST-like and do not implement all HTTP verb in the manner they are supposed to. For example; when creating new resources, most developers use POST instead of PUT. Even deleting resources are sent through POST request instead of DELETE.   SOAP also defines a binding to the HTTP protocol. When binding to HTTP, all SOAP requests are sent through POST request.   Security Security is never mentioned when discussing the benefits of REST over SOAP. Two simples security is provided on the HTTP protocol layer such as basic authentication and communication encryption through TLS. SOAP security is well standardized through WS-SECURITY. HTTP is not secured, as seen in the news all the time, therefore web services relying on the protocol needs to implement their own rigorous security. Security goes beyond simple authentication and confidentiality, and also includes authorization and integrity. When it comes to ease of implementation, I believe that SOAP is that at the forefront.   Conclusion This was meant to be a short blog post but it seems we got to passionate about the subject.   I accept that there are many other factors to consider when choosing SOAP vs REST but I will over simplify it here. For machine-to-machine communications such as business processing with BPEL, transaction security and integrity, I suggest using SOAP. SOAP binding to HTTP is possible and XML parsing is not noticeably slower than JSON on the browser. For building public facing API, REST is not the undisputed champion. Consider the actual application requirements and evaluate the benefits. People would say that REST protocol agnostic and work on anything that has URI is beside the point. According to its creator, REST was conceived for the evolution of the web. Most so-called RESTFul web services available on the internet are more truly REST-like as they do not follow the principle of the architectural style. One good thing about working with REST is that application do not need a service contract a la SOAP (WSDL). WADL was never standardized and I do not believe that developers would implement it. I remember looking for Twitter WADL to integrate it.   I will leave you to make your own conclusion. There is so much I can write in a blog post. Feel free to leave any comments to keep the discussion going.

Sunday, 20 February 2011

Cloud computing vs Open Source - Most CIO cannot tell the difference


Few weeks ago, I posted a discussion here in a CIO forum on LinkedIn and frankly some of the comments are very interesting to say the least. Now I decided to bring some technical guys to the discussion table. My argument was and still is as follow
“I have been reading many threads about Cloud computing and I came to conclude that most CIO (maybe because of their business background) do not know the difference or real benefits of Cloud computing or Open Source software.

Hi, I am not expecting everyone to agree with me but here is my argument. Most CIOs are interested in Cloud computing because of cost. COST!!? That's very interesting because to my humble opinion, this only applies to IaaS (Infrastructure as a Service). If you do not want to spend money on hardware and be left with redundant system then IaaS is a good approach but that's about it. I work with Cloud computing (specifically SaaS) and this next one might hurt my business but it has to be said; SaaS is not cost saving when you comparing it Open Source alternatives that you can host on your IaaS system…. Read more here
I am not sure that they understood the argument. I was not expecting anybody too agree with me and I wanted CIOs in the group to share their insight not sound like a copy of a Gartner report. Before making any conclusion, keep in mind that I am talking here about Software as a Service (SaaS), as defined here. In network architecture design, the external network  is represented by the “cloud” symbol therefore I would have to agree Wikipedia’s definition of cloud.  It is a software served over an external network regardless of a private network (private cloud) or public network (public cloud). YES – the internet was built on cloud technology. If you use any software over the internet; be it email, search, video or social network, the system is hosted by an external party which you do not have control over. The name cloud is just a marketing gimmick because hosted applications have been around for more than 20 years since Compuserve and Internet Relay Chat (IRC & BBS). So you see, “cloud” is definitely not new. Therefore software delivered over the internet such as Google apps and Salesforce can be also deployed using Open Source alternative. Cloud promises the following: scalability, peace of mind as it maintained by the providers and lower cost. CIO, I will tell you that your software, that it is deployed in the cloud or not will not be able to scale beyond the hardware and network capacity. I have another question for CIOs:

Do CIOs care or know where all their applications are running? 

That question is usually left to the technical team to decide within the budgets of the project and any other company politics. The biggest failures of IT projects is due to the fact that the CIO (or “the business” as it is usually referred as) do not know what they are trying to achieve (lack or misunderstandings of requirements) therefore it goes past the delivery and budget. 

So where does Open Source fits in, one might ask? Open Source software allows a business to take best of breed software and customised them to their own needs for free (as in free beer). If you do not want to support the Open Source software you can get support services but the software is hosted on your own system including your private cloud (Infrastructure as a Service). Let’s put it in to context; if a company requires a CRM system - they can download vTiger, customise it and either support it themselves or buy support. The same goes for an ERP system like Apache Ofbiz and MySQL for database. I am in favour of SaaS offering, after all I run a SaaS-based company. Nevertheless, CIOs do not confuse SaaS as being cheap, if you want something that has a low cost of ownership, then I suggest you go for an Open Source alternative if it exists. So why do I say that most CIO cannot tell the difference; SaaS is not cheap and does not have a lower cost of ownership when comparing it to Open Source alternatives. And by the way, you do not need to have an army of developers to build and customise your Open Source software. Do you really want the SaaS provider on a shared system to have access to your LDAP system? What happens when you want to integrate or port your existing data to your new fancy cloud based system? CIOs should not try to lie to me. I attended many meetings and conferences to know that most of them just want to please the board. What are the differences between cloud and virtualisation? What happens to your existing hardware once you moved your applications to cloud, have you thought of using them for virtualisation? So please do not make uneducated comments as “I don't know a single CIO who can't tell the difference between Cloud Computing & Open Source - maybe I move in different circles.” I am not talking about dictionary or Gartner definitions.  

CIOs, after reading this and before replying you should go and sit down with your technical team and ask them the difference, only after that you can provide a good educated comment. If you want to be on the “cloud” train then you are free to do so but if SaaS is not part of cloud offerings, please feel free to enlighten me as I am always willing to learn something new.
Who should make the decisions to go cloud or not? You are the CIOs, you tell me. Is it the developer, the architect, the project manager or the almighty CIOs from his ivory tower? There is no trickery here, every fool can define a word – just do this; think of a word then Google using the following “what is ‘the word’” then voila your definition. If you need someone to school you up then drop me an email. Based on the comments on LinkedIn, all I can say is WOW. Leave the technical aspect to the technical guys and you can focus on playing golf.



  • Blogger Comments
  • Facebook Comments

8 comments :

  1. Thank you for sharing this article.
    us vpn

    ReplyDelete
  2. This is one of the interesting post.I like your blog details.This is one of the impressive post.Good.
    Android app developers

    ReplyDelete
  3. These are very interesting and useful points discussed here. Keep it up.
    Cloud Network

    ReplyDelete
  4. Informative post. You have provide a great information regarding cloud computing. Keep awaiting for more post.

    cloud accounting

    ReplyDelete
  5. I havent any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. simply buzzes

    ReplyDelete
  6. Rest room marketing techniques you pertinent query previous to building. Will probably be quick to write down remarkable write-up because of this. Software

    ReplyDelete
  7. Great content, amazing post altogether! keep posting such quality posts would be delighted to be updated with the latest on your blog,
    Regards
    Best Cheap Web Hosting

    ReplyDelete
  8. With the overwhelming competitions in the web hosting market with different web hosting companies offering more or less the same types of web hosting features, selecting the best web service provider out from thousands of companies had never being more daunting than now. A free page builder for website provides their clients a specific website to work on like their own for their different usage with no charges.

    ReplyDelete

Item Reviewed: Cloud computing vs Open Source - Most CIO cannot tell the difference Description: Rating: 5 Reviewed By: Unknown