REST, the web service newcomer
Conceptual, Web 2.0 April 26th, 2008Keeping with the trend of web services, I figured I would take the time to give a brief overview of the two major service types. The one I will obviously cover first is the called REST. This is an acronym for Representational State Transfer, but that does not really tell you much about it. REST is the newcomer when compared to its popular counterpart, SOAP. The idea behind REST is quite simple, its base principle is that everything is a resource. This is similar in principle to object-oriented principles which treats everything as an independent object. Since every resource is independent from each other, the programmer must set up relations between these resources in order to provide access links to related data.
Once the structure is setup with the required resources we need a way to modify these resources. REST provides a very simple interface for manipulation, it uses the existing HTTP protocol that has been around for over a decade. Now if you are familiar with HTTP protocol you are thinking, “So all you do is use GET and POST commands?” Well, yes you do use these but other requests are required. GET and POST are the most common of the two because these are the only ones primarily used by web browsers. However there are actually nine different request types in the HTTP protocol. A few of these are GET, PUT, POST, and DELETE.
Each of the for items listed above are associated with the CRUD principle of resource manipulation. CRUD i another acronym (yes, programmers love acronyms) which stands for Create Read Update Delete. These are the main operations required on every resource. These operations are then associated with the HTTP protocols listed above. The POST request is assigned to anything related to creating and updating data. The GET request is used for retrieving resource information (read). Lastly PUT and DELETE requests are used for updating and destroying resources.
Now very briefly here are some advantages of using REST over SOAP for a web service:
- Provides improved response times and server loading characteristics due to support for caching
- Improves server scalability by reducing the need to maintain communication state. This means that different servers can be used to handle initial and subsequent requests
- Requires less client-side software to be written than other approaches, because a single browser can access any application and any resource
- Depends less on vendor software than mechanisms which layer additional messaging frameworks on top of HTTP
- Provides equivalent functionality when compared to alternative approaches to communication
REST seems to be the up and coming technique to the tride and true SOAP approach. In my next articles I will tell you what SOAP has to offer and then lastly compare the two to help you decide which is right for your application.
Add Ri to Favorites
Follow us on Twitter
Add Ri on Facebook
See our Stumbles
See our Diggs
Check our bookmarks