Re:Amazon proves that REST doesn’t matter for Cloud APIs
by cemerick on Tuesday December 07, 2010 @06:31AM
(#1978746)
Capability trumps everything else.
If AWS sucked, or was merely a typical collection of services, then details about its API design might matter. Of course, AWS isn't typical – it's exceptional. Thus, its API could require the use of carrier pigeons and people would still be lining up to use it.
That said, nicer APIs are nicer. As someone that has programmed directly to EC2's APIs, I so wished they were less crufty. I now use jclouds (via pallet), so I thankfully don't have to think about such things anymore.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by locopati on Tuesday December 07, 2010 @06:22AM
(#1978734)
I find that RESTfulness improves the quality of design by forcing a little consideration on how to represent resources and actions on resources. The alternative is often littering the API with actions anytime a new one is needed - once that first version is out in the wild, it becomes a lot harder to take the time to consider the design choices. REST gives you a conceptual framework in which to implement new functionality.
In addition, all the consumers get the benefit of a common specification - if you tell me your service is RESTful, I can probably start making requests without even knowing much more than a starting URI, because I know how GET, POST, PUT, and DELETE will behave; I know what the error/success codes are going to look like; I can guess that Content-Type is going to drive the input and Accept will drive the output.
Sure, the consumer is probably going to leap through whatever hoops I put out there if they want my data, but RESTfulness is a courtesy, extending a hand and saying I'm not going to make extra work for you.
In the case of the OP, I'd say "Amazon proves that people who want to use a well-designed and beneficial service will work with whatever they're given".
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by toolate on Tuesday December 07, 2010 @07:34AM
(#1978853)
Amazon's API format is irrelevant because their service is so popular. Once the API is stable and client libraries are available for common languages most developers will be unaware of the actual mechanics.
If you're launching a startup then you don't want to give your early adopters an excuse to not work with your API. If you're developing an API for internal use then you won't be using an off the shelf client library in any case.
Furthermore, a clean API is a sign to other developers that you know what you are doing. If you are targetting an industry where coders get a say on whether or not they will choose your service then you'd better put your best foot forward. I've seen far too many APIs that show a company has no clue on the technical side, which causes me to cast doubt on other parts of their service.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by sriramk on Tuesday December 07, 2010 @05:03AM
(#1978580)
The OP is completely correct. I designed a bunch of the Windows Azure APIs - we spent a lot of time making sure they were RESTful. Looking back now, I think it was a big waste of time. Almost everyone uses the API through some custom library and I doubt it would have mattered if we hadn't taken the trouble.
I'm involved in some API design again and I sent out a mail saying that any discussions involving whether option A or option B is the more 'rest-ful' thing to do will get smacked down :)
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by aaronbrethorst on Tuesday December 07, 2010 @06:06AM
(#1978706)
Hey Sriram - When are we getting coffee? I'll code against Amazon's gnarly API because I have to, not because I want to. Flickr's another great example of this. I mean, seriously, look at some of the calls, here: http://www.flickr.com/services/api/
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by DeusExMachina on Tuesday December 07, 2010 @05:58AM
(#1978677)
From personal experience where I work (mobile apps company) I can say that a RESTful API is a good choice usually in terms of familiarity and reuse of code. We usually work with RESTful APIs, so when a new one comes, we already have our internal libraries to handle it, speeding up development.
But we work with other kinds of APIs as well, when a client asks. Apart having to do more work since we don't have code to reuse for that, we have no other problems.
If it works well, it does not matter if it's RESTful or not. But as for everything, if you are familiar with something, you are usually faster and more accurate.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by navyrain on Tuesday December 07, 2010 @05:17AM
(#1978605)
If you ignore the APIs, AWS still has a substantial number of merits which make it a formidable player. It is a huge leap to say that because the market has smiled on AWS, we all love everything about it and wouldn't prefer more of it be REST-ful.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by dansingerman on Tuesday December 07, 2010 @04:36AM
(#1978541)
"Every time a new Cloud API is announced, its “RESTfulness” is heralded as if it was a MUST HAVE feature. And yet, the most successful of all Cloud APIs, the AWS API set, is not RESTful."
I think whether you have REST or REST-like (i.e. RPC over HTTP) doesn't matter so much, as long as it's not SOAP.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by kondro on Tuesday December 07, 2010 @07:16AM
(#1978827)
The RESTfulness of an API is of very low concern on how I choose a service to use and the quality of the service is paramount.
If the API lets me get things done and/or provides an abstraction library in my language of choice so I never have to see it, I really couldn't care less how it is written.
Does REST make more semantic sense? Of course, but if your app has no features or consistently loses my data, I couldn't give a shit.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by _stephan on Tuesday December 07, 2010 @05:50AM
(#1978658)
Could maybe someone give a concise definition of what makes an API RESTful and explain why the AWS Query API is not RESTful and how a RESTful API would be better?
Applying this to one of Vambenepe's examples of an AWS method--
"AWS mostly uses RPC over HTTP. You send HTTP GET requests, with instructions like ?Action=CreateKeyPair added in the URL..."
you can see that it's not RESTful. A RESTful version of this method would have something like "KeyPairs" in the URL path rather than in the query string, and it would use POST rather than GET to signify a create operation.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by rue on Tuesday December 07, 2010 @06:49AM
(#1978777)
URLs really have very little to do with REST beyond uniqueness, even though it is popular in "RESTful" APIs to encode objects in URLs. A POST /keypair/create or whatever could just as well be POST /1234567890123. The important bits of REST are representations, state(lessness) and relationships or links.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by _stephan on Tuesday December 07, 2010 @06:54AM
(#1978790)
Thanks for the pointer. I read the Wikipedia page, but I found the explanation of the general concept too abstract. The definition of a RESTful web service further down the page is much clearer.
However, does it really make any practical difference whether the API makes full use of all the HTTP methods (GET, PUT, POST, DELETE)? Sure, it may be a bit of an abuse of the protocol to encode everything as a GET, but since you usually don't want any caching when using such an API, does it really matter?
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by byoung2 on Tuesday December 07, 2010 @08:56AM
(#1979003)
I'm designing a RESTful api at the moment and using get, post, put, and delete to represent select, insert, update, and delete gives users a clear pattern when new features are added. Right now say there are just photos in my app. Post json or XML to /photos to create a new one, put to /photos/123/ to update. Now I announce that I'm adding videos. The pattern is exactly the same, the URL is just / videos. But I suppose you're right, I could achieve the same effect with ?object=video&action=createNew, but why make users learn a new vocabulary?
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by arebop on Tuesday December 07, 2010 @08:45AM
(#1978980)
Yes, because when you don't play by the standard rules, it's hard to find others to play with you. Cache servers are just one example. Another example: web browsers. Note that web browsers are still useful against REST services, even if they don't have good support for PUT or DELETE.
In general, REST provides discoverability and interoperability that you don't get without a uniform interface.
Re:Amazon proves that REST doesn’t matter for Cloud APIs
by Semiapies on Tuesday December 07, 2010 @01:57PM
(#1980103)
Aside from the blatant strawmanning of the article, consider a rephrasing:
"Every time a new API is announced, its 'nice-to-work-with-ness' is heralded as if it was a MUST HAVE feature. And yet..."
People work with what they have available to them. If another service came into existence that was in all respects the same as EC2, but had a nice, RESTful API, it would have an advantage.
If AWS sucked, or was merely a typical collection of services, then details about its API design might matter. Of course, AWS isn't typical – it's exceptional. Thus, its API could require the use of carrier pigeons and people would still be lining up to use it.
That said, nicer APIs are nicer. As someone that has programmed directly to EC2's APIs, I so wished they were less crufty. I now use jclouds (via pallet), so I thankfully don't have to think about such things anymore.
In addition, all the consumers get the benefit of a common specification - if you tell me your service is RESTful, I can probably start making requests without even knowing much more than a starting URI, because I know how GET, POST, PUT, and DELETE will behave; I know what the error/success codes are going to look like; I can guess that Content-Type is going to drive the input and Accept will drive the output.
Sure, the consumer is probably going to leap through whatever hoops I put out there if they want my data, but RESTfulness is a courtesy, extending a hand and saying I'm not going to make extra work for you.
In the case of the OP, I'd say "Amazon proves that people who want to use a well-designed and beneficial service will work with whatever they're given".
If you're launching a startup then you don't want to give your early adopters an excuse to not work with your API. If you're developing an API for internal use then you won't be using an off the shelf client library in any case.
Furthermore, a clean API is a sign to other developers that you know what you are doing. If you are targetting an industry where coders get a say on whether or not they will choose your service then you'd better put your best foot forward. I've seen far too many APIs that show a company has no clue on the technical side, which causes me to cast doubt on other parts of their service.
I'm involved in some API design again and I sent out a mail saying that any discussions involving whether option A or option B is the more 'rest-ful' thing to do will get smacked down :)
I think it's way more logical to POST a photo_id to http://flickr.com/galleries/123456/photos than to POST to http://www.flickr.com/services/rest/?method=flickr.galleries... (note: HN is truncating the displayed link.)
Then again, I don't think I'm in the target demographic for Azure.
But we work with other kinds of APIs as well, when a client asks. Apart having to do more work since we don't have code to reuse for that, we have no other problems.
If it works well, it does not matter if it's RESTful or not. But as for everything, if you are familiar with something, you are usually faster and more accurate.
I think whether you have REST or REST-like (i.e. RPC over HTTP) doesn't matter so much, as long as it's not SOAP.
That's what people are lauding.
If the API lets me get things done and/or provides an abstraction library in my language of choice so I never have to see it, I really couldn't care less how it is written.
Does REST make more semantic sense? Of course, but if your app has no features or consistently loses my data, I couldn't give a shit.
http://en.wikipedia.org/wiki/Representational_State_Transfer...
Applying this to one of Vambenepe's examples of an AWS method--
"AWS mostly uses RPC over HTTP. You send HTTP GET requests, with instructions like ?Action=CreateKeyPair added in the URL..."
you can see that it's not RESTful. A RESTful version of this method would have something like "KeyPairs" in the URL path rather than in the query string, and it would use POST rather than GET to signify a create operation.
I think the best place to start from would be the Fielding dissertation: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch....
However, does it really make any practical difference whether the API makes full use of all the HTTP methods (GET, PUT, POST, DELETE)? Sure, it may be a bit of an abuse of the protocol to encode everything as a GET, but since you usually don't want any caching when using such an API, does it really matter?
In general, REST provides discoverability and interoperability that you don't get without a uniform interface.
Amazon can afford to have an inelegant API as they're already dominant (and when they launched, they didn't have many competitors).
If someone launching an Amazon EC2 competitor today strapped together a pig-ugly set of RPCs over HTTP, I doubt it would encourage its use.
Elegant APIs are a sign that you respect developers.
"Every time a new API is announced, its 'nice-to-work-with-ness' is heralded as if it was a MUST HAVE feature. And yet..."
People work with what they have available to them. If another service came into existence that was in all respects the same as EC2, but had a nice, RESTful API, it would have an advantage.
Barring that, people use EC2.