A 20-minutes presentation I gave at the 2011 Jazoon conference in Zurich about RESTful architectures, REST antipatterns and how to implement scalability and adaptability in our systems.
22. RESTful clients should
be driven by service's
hypermedia controls
Roy Fielding : http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
SPEAKER‘S COMPANY
LOGO
35. HTTP in a nutshell:
1. Client <> Server
SPEAKER‘S COMPANY
LOGO
36. HTTP in a nutshell:
2. Stateless
SPEAKER‘S COMPANY
LOGO
37. HTTP in a nutshell:
3. widespread cache spec
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
SPEAKER‘S COMPANY
LOGO
38. HTTP in a nutshell:
Lao Tze Song office's laptop
Company proxy
Great chinese (fire)wall
Reverse proxy
Origin server
4. Layered system
SPEAKER‘S COMPANY
LOGO
39. HTTP in a nutshell:
5. it is the uniform interface
between clients and servers
SPEAKER‘S COMPANY
LOGO
46. HTTP/1.1 200 OK
Host: www.example.com
Expires: Tue, 31 Jan 2011 01:00 GMT
SPEAKER‘S COMPANY
LOGO
47. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: max-age=60, public
SPEAKER‘S COMPANY
LOGO
48. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: max-age=60, public
SPEAKER‘S COMPANY
LOGO
49. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: max-age=60, public
Cacheable for 60 seconds
SPEAKER‘S COMPANY
LOGO
50. GET / HTTP/1.1
Host: www.example.com
Cache-Control: max-age=60, public
Cacheable by both local and shared caches
SPEAKER‘S COMPANY
LOGO
51. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
SPEAKER‘S COMPANY
LOGO
52. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
fault-tolerant
SPEAKER‘S COMPANY
LOGO
53. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
available during downtime
SPEAKER‘S COMPANY
LOGO
54. HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
available during revalidation
SPEAKER‘S COMPANY
LOGO
62. HTTP's cache fails when dealing with really dynamic
pages, because consumers will always have to hit the
origin server, although a part of the page would be
cacheable ( header and footer, for example )
SPEAKER‘S COMPANY
LOGO
64. ESI was built for that
http://www.w3.org/TR/esi-lang
SPEAKER‘S COMPANY
LOGO
65. Edge Side Includes
Server side includes ( not SSI! ) usually handled by
the architecture's ESI processor.
http://www.w3.org/TR/esi-lang
http://www.w3.org/TR/edge-arch
SPEAKER‘S COMPANY
LOGO
86. POST /users
Host:
www.example.com
HTTP/1.1 201 Created
Host: www.example.com
Etag: 1234
X-Powered-By: php/5.3
Location: /users/1
SPEAKER‘S COMPANY
LOGO
87. POST /users
Host:
www.example.com
HTTP/1.1 201 Created
Host: www.example.com
Etag: 1234
X-Powered-By: php/5.3
Location: /users/1
SPEAKER‘S COMPANY
LOGO
88. POST /users
Host:
www.example.com
HTTP/1.1 201 Created
Host: www.example.com
Etag: 1234
X-Powered-By: php/5.3
Location: /new-users-db/1
SPEAKER‘S COMPANY
LOGO
89. POST /users
Host:
www.example.com
HTTP/1.1 201 Created
Host: www.example.com
Etag: 1234
X-Powered-By: php/5.3
Location: /new-users-db/1
SPEAKER‘S COMPANY
LOGO
90. consumers of your API are able to follow
the changes of your design
SPEAKER‘S COMPANY
LOGO
96. "REST is software design on the scale of decades: every detail is intended to
promote software longevity and independent evolution. Many of the constraints
are directly opposed to short-term efficiency. Unfortunately, people are fairly
good at short-term design, and usually awful at long-term design. "
Roy Fielding
SPEAKER‘S COMPANY
LOGO
97. Put a bit of
REST
everywhere
SPEAKER‘S COMPANY
LOGO
101. Vol.3
REST is not a panacea
SPEAKER‘S COMPANY
LOGO
102. SOAP
No need to re-invent the wheel: if you need to do SOAP integration, SOAP
is the way.
If you have a completely functional SOAP service, no - apparent - need to
rewrite it RESTful from scratch.
SPEAKER‘S COMPANY
LOGO
103. AGILE
The last responsible moment conflicts with REST.
But quality enhance agility: REST is quality.
SPEAKER‘S COMPANY
LOGO
104. LIMITED
HORIZON
My blog won't ever be RESTful.
But incremental design, bare it in mind.
SPEAKER‘S COMPANY
LOGO
105. Alessandro Nadalin odino.org
DNSEE @_odino_
Rome github.com/odino
SPEAKER‘S COMPANY
LOGO