On Tue, Mar 30, 2010 at 08:05:36PM +0100, Mark McLoughlin wrote:
Hi,
I've been reading about REST and trying to put together a convincing
list of reasons why we should choose it over SOAP:
- There's a lot of buzz about it right now - twitter, flickr,
facebook, S3, deltacloud etc. are all basing their APIs on it[1]
FYI, flickr actually exposes their API via REST, SOAP and XML-RPC
http://www.flickr.com/services/api/
- RHEV-M runs on JBoss and there's a significant REST push in
the
JBoss community (lead by Bill Burke) with RESTeasy, REST-* etc.
- It makes APIs very easy to understand and play with - just look at
some of the popular RESTful APIs ... you could imagine doing
something fun with them after 5 minutes hacking
- A RESTful API is largely self describing - e.g. the XML/JSON
representation of a VM would include links for each VM action
available
- In theory, there should be less interoperability issues because of
the simplicity
- Resources are addressable - you can imagine all sorts of
interesting possibilities from being able to pass around a URL for
a VM, for example
- Easier to consume RESTful APIs in AJAX apps
I think this is something not to be underestimated. The key is that it
is making the API easy to consume by any HTTP web client, rather than
just those web clients with a SOAP client. Lowering the barrier to using
the API will broaden the community of developers.
And some disadvantages:
- At first, it looks trivial to design a good RESTful API ... but the
more I read, the more really subtle issues[3] there are to think
about - you only need to look at all the controversies about
various APIs being denounced as not truly RESTful
I think these "constroversies" are simply an artifact of REST's
flexibility.
As with Perl there is more than one way todo it in REST, and you just have
to ignore the architecture astronauts trying to convince you that theirs'
is the one true way todo REST.
- Similarly, what we essentially want is an RPC API, but thinking
about REST as just another API protocol almost guarantees you'll do
it wrong
- It doesn't look like there is the same level of auto-generated
client bindings available as there is with SOAP/WSDL[4]
Isn't this point just a reflection on the relative complexities of SOAP vs
REST.
Perhaps it's just a case of being turned off REST by the elevated
levels
of hype and the angst-ridden battles going on over just what is and
isn't RESTful[5]
Daniel
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://deltacloud.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|