Thursday, December 27, 2007

Reviewing the REST architectural style

These simple principles are easy to forget, so I'm reviewing them again.  A little midweek book report.

Fielding's REST architectural style formalizes the first best well known, scalable use of HTTP.  Fielding's context is the web in its greatest expanse, including all manner of edge devices, caches and other proxies that lend considerably to scalable infrastructure at critical points.  The global infrastructure benefits from the maintenance of its essential principles.
  • An HTTP resource is representated by a content object location (URL), for example "/path/file.html".  Technically, not redirecting "GET /" to "GET /index.html" is bad (vanity) practice. The reference "/" should not have content. The corresponding "PUT /" or "DELETE /" would be ambiguous, and (hopefully) undefined.   
  • The performance of the HTTP operators (GET, PUT and DELETE) on an applicable resource should be bounded by the network. This seems implicit.

In REST, Fielding emphasizes the (HTTP) Response Entity Body as a sequence of bytes identified by the combination of the (HTTP) Request Line and the (HTTP) Response Headers (metadata).

The Amazon S3 store has an interesting familiarity with Fielding's principles for REST.  The S3 PUT request defines metadata headers for the subsequent GET response.

No comments: