REST 2/n

I’ve continued reading REST: from research to practice and, as expected, Amundsen’s chapter was the best one. Let’s see the relevant parts of the next 4 chapters:

REST and Web Services: In Theory and in Practice

A comparison between WS–* (SOAP and more) and REST services, focused on the current (2011) popularity and architectural differences. There are several, laughable (IMHO), cites:

On the level of architectural principles, (...) analyze three principles (protocol layering, dealing with heterogeneity, and loose coupling) and note that both styles support these three principles. However, they can identify only one aspect common to both styles – loose coupling to location (or dynamic late binding).

To be fair, it’s from a paper the authors are analyzing… I think that those high-level analysis (disregarding developer experience, simplicity, actual code…) are deeply flawed. With that analysis the paper authors achieve this conclusion:

Based on these results, the authors recommend using REST for ad-hoc integration and using WS– for enterprise-level application integration where transactions, reliability, and message-level security are critical.

Still, it was 2011 and people were trying to second guess who was going to win (spoiler, REST did). The authors did a survey of existing web services, they compare several “REST” frameworks (Django, JAX-RS…) and they arrive at this conclusion: REST frameworks are not ready for the enterprise.

Today’s frameworks are not yet ready to support enterprise needs. They do not implement advanced security features or transactions; they do not verify that HTTP methods they generate are idempotent, which is the necessary prerequisite for reliable messaging; they are not scalable.

We have to remember that Google, Amazon, Twitter (heck, even Instagram) had already released successful REST APIs back then.

The only interesting tidbit (this chapter has suffered hard the 8-year gap) is the acknowledgment that, although REST was started in the academia in the year 2000, universities and papers weren’t studying REST at all (the first REST workshop in academia was in 2010!). REST was picked by the industry and lost the favor of the academia.

The chapter ends in a high note, being hopeful of RESTful services being able to scale, be extensible and secure.

RESTful Domain Application Protocols

Buf. A dull example of implementing a booking system, it contains 2 relevant things:

Hypermedia Types

The best chapter so far.

Amundsen introduces hypermedia talking about the web and defines “Nine Hypermedia Factors”, that support hypermedia behaviors. And those are:

Later, he analyses several formats based on this restrictions and introduces PHACTOR, a new format that checks all the boxes :)

Beyond CRUD

REST + UML, I died here.

Last words (for now)

I’ll be back.

I’ve given several talks on REST and Hypermedia… these are the slides I’m most proud of (because the theme is based on Cindy Lauper, and Cindy Lauper is God).

I’m on twitter at nhpatt if you want to read more, sporadic, ramblings :)