12/17/07 :: [REST] The Very Dark Side of REST [permalink]

You probably noticed that the REST community has stopped talking with me. John Heintz had the integrity to go to end of the discussion on discussing what is required to establish a shared understanding at the action level when a human is NOT in the loop. The fact and the matter is that you CANNOT DO WITHOUT A CONTRACT (to establish the shared understanding).

I also appreciated the discussion I had with Teo Hui Ming on discussing whether "Search" was RESTful?. I really enjoy this kind of discussion. My understanding is that Teo has to bring APP in the picture (a spec !!!) to answer the question, and yet could not answer it completely. The fact and the matter is that a Result Set IS-NOT a resource.

These were the only two people that had the courage to go to the end of the discussion even though they saw some limitations to the REST approach. Others, have stopped all communication as soon as they understood the problems with REST.

This week-end, Amazon published a great little service to complete its AWS collection (I am wondering if soon we are going to have Service Fashion Shows where Amazon, Google, Microsoft and others will showcase their work).

That was enough to wake up the inquisition lead by the grand priests of REST who were absolutely outraged at Amazon's latest heresy. Bill de Hora, Stefan Tilkov, Assaf Arkin, Subbu ... were all ready to burn the heretic who had committed one of the worst crime in REST history. Funny, how mechanical their reaction is: never discuss the questions always point at what not to do and occasionally what to do. There is never a single inconsistency in a religion -by definition.

Subbu who was recently caricaturing my arguments by saying that "REST does not support Web Services Choreography, and hence REST is unfit for the enterprise ", discussed today the SimpleDB in the context of action based API. He learned his lesson and decided to avoid quoting me, as if I had never discussed the relationship between REST and Actions. His argument today was impeccable. He demonstrated brilliantly how REST should be used, when it can be used. I totally, absolutely agree with him that when you need to update the "content" of a resource, you MUST NOT use an action oriented interface. Unfortunately, he wanted you to come to the conclusion (insidiously) that "all action interfaces" are bad (Nice try Subbu) . The point I have been trying to make all along is that the actions should only be used to change the state of a resource. Even when a human is in the loop, REST is not that stupid, it uses links (not PUTs) to update the state of a resource, but when there is no human, magically, you don't need actions anymore. For those of you who are not convinced yet, I suggest that tomorrow you try to drive your car with a (GET,PUT) interface (no links allowed) and then you tell me how you felt: a state machine is a state machine and there is no way around it, yes, Bill, the order in which you invoke actions does matter.

Now back to SimpleDB. The RESTifarians are so religious about their beliefs that they cannot see the obvious. They missed a couple details. The first one is the API's version:

https://sdb.amazonaws.com/?Action=PutAttributes
&DomainName=MyDomain
&ItemName=Item123
&Attribute.1.Name=Color&Attribute.1.Value=Blue
&Attribute.2.Name=Size&Attribute.2.Value=Med
&Attribute.3.Name=Price&Attribute.3.Value=14.99
&AWSAccessKeyId=<valid_access_key>
&Version=2007-11-07
&Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQE=
&SignatureVersion=1
&Timestamp=2007-06-25T15%3A01%3A28-07%3A00

It has been notorious that REST is really bad at versioning (I am preparing an article on this topic that will be published early January). Of course the RESTifarian say that there is absolutely no need for versioning since there is only ONE interface (GET, PUT, POST, DELETE) and actions don't exist. Have you tried to bake in versioning in a RESTful resource access? you mean that the URI of the resource depends of the version? Ouch...

The second detail they missed is that Amazon is probably going to publish BigDB at some point and maybe they will want to develop a true CRUD, SQL based API. Have you ever tried to implement this kind of API in a RESTful way? huh? you mean you can't?

Guys, REST alone is a sinking ship -Amazon has given up on REST where it does not work- you are misleading yourself and wasting everybody's time in the process.

|