Busy Architect's Guide to REST

ted@tedneward.com | Blog: http://blogs.tedneward.com | Twitter: tedneward | Github: tedneward | LinkedIn: tedneward

Objectives

We're aiming to do a couple of things here

History of the Web

How we got here

History

History

Stage One: Xanadu

History

Stage One: Xanadu

"Xanadu, a global hypertext publishing system, is the longest-running vaporware story in the history of the computer industry. It has been in development for more than 30 years."

History

Stage One: Xanadu

"Xanadu was meant to be a universal library, a worldwide hypertext publishing tool, a system to resolve copyright disputes, and a meritocratic forum for discussion and debate. By putting all information within reach of all people, Xanadu was meant to eliminate scientific ignorance and cure political misunderstandings. And, on the very hackerish assumption that global catastrophes are caused by ignorance, stupidity, and communication failures, Xanadu was supposed to save the world."

History

Xanadu's 17 Rules:

    Every Xanadu server is uniquely and securely identified.

    Every Xanadu server can be operated independently or in a network.

    Every user is uniquely and securely identified.

    Every user can search, retrieve, create and store documents.

    Every document can consist of any number of parts each of which may be of any data type.

    Every document can contain links of any type including virtual copies ("transclusions") to any other document in the system accessible to its owner.

History

Xanadu's 17 Rules:

    Links are visible and can be followed from all endpoints.

    Permission to link to a document is explicitly granted by the act of publication.

    Every document can contain a royalty mechanism at any desired degree of granularity to ensure payment on any portion accessed, including virtual copies ("transclusions") of all or part of the document.

    Every document is uniquely and securely identified.

    Every document can have secure access controls.

    Every document can be rapidly searched, stored and retrieved without user knowledge of where it is physically stored.

History

Xanadu's 17 Rules:

    Every document is automatically moved to physical storage appropriate to its frequency of access from any given location.

    Every document is automatically stored redundantly to maintain availability even in case of a disaster.

    Every Xanadu service provider can charge their users at any rate they choose for the storage, retrieval and publishing of documents.

    Every transaction is secure and auditable only by the parties to that transaction.

    The Xanadu client-server communication protocol is an openly published standard. Third-party software development and integration is encouraged.

History

Stage Two: Simple Browser

History

Stage Three: Simple Server

History

Stage Four: Complex Browser

History

Stage Five: Complex Server

History

Stage Six: Integration/APIs

HTTP

Quick recap of HTTP details

HTTP/1.1 Protocol Details

Jumping into the Web pool

HTTP Protocol

HTTP/1.1: RFC 2616

HTTP Protocol

Dependencies

HTTP Protocol

Basic details

HTTP Protocol

Quick note: stateless

HTTP Protocol

Basic protocol notes

HTTP Protocol

Request packet

GET / HTTP/1.1
Host: www.newardassociates.com
Accept: */*

HTTP Protocol

Response packet

200 OK HTTP/1.1
Content-Type: text/html
Content-Length: 32

<html><body>Howdy!</body></html>

HTTP Protocol

Request packet

HTTP Protocol

Request methods

HTTP Protocol

Request methods

HTTP Protocol

Request-URI

HTTP Protocol

HTTP-Version

HTTP Protocol

Header: Value lines

HTTP Protocol

CRLF (empty line)

HTTP Protocol

Content body

HTTP Protocol

Response packet

HTTP Protocol

Status-Code

HTTP Protocol

Reason-Phrase

HTTP Protocol

HTTP-Version

HTTP Protocol

Header: Value lines

HTTP Protocol

CRLF (empty line)

HTTP Protocol

Content body

HTTP Protocol

Common headers

HTTP Protocol

Common headers

HTTP Protocol

Common headers

HTTP Protocol

Common headers

HTTP Protocol

For more information

REST

Representational State Transfer

REST

Representational State Transfer

REST

REST

In other words...

REST

In other words...

REST

"Resource Modeling"

REST

There's something to be said for this model

REST

Advantages

REST

Disadvantages

Richardson Maturity Model (RMM)

How RESTful are you?

Maturity Model

In 2008, Lenny Richardson posited the "Richardson Maturity Model"

Maturity Model

The RMM reads like this:

Maturity Model

Stage Zero: POX/SOAP/XML-RPC

Maturity Model

Stage One: "Resources"

Maturity Model

Stage Two: HTTP Verbs

Maturity Model

Stage Three: HATEOAS

Problems

Utopia is a little harder than that

Problems

Issues with HATEOAS

Problems

Issues with HTTP

Summary

Wrapping up

Credentials

Who is this guy?