SlideShare a Scribd company logo
1 of 106
Download to read offline
REST in peace
                                   A handbook of software waste




Alessandro Nadalin
DNSEE
430




                      SPEAKER‘S COMPANY
                           LOGO
AGENDA
> Vol. 1: REST in a nutshell             > Vol. 2: To the rescue
  – Tenets                                 – HTTP cache
   –   Antipatterns                          –   ESI
> WWW: a tremendous architecture             –   HATEOAS
  – Stateless                            > Vol. 3: REST is not a panacea
   –   Layered                             – SOAP
   –   Cacheable                             –   Limited horizon
   –   Fault-tolerant                        –   Agile development
   –   Failure-prone



                                                                           2




                         SPEAKER‘S COMPANY
                               LOGO
Sorry for the ugly slide.

 There will be others.
    Really sorry.


      SPEAKER‘S COMPANY
           LOGO
REST in a nutshell:




1. Client <> Server
     SPEAKER‘S COMPANY
          LOGO
REST in a nutshell:




                 2. Stateless
     SPEAKER‘S COMPANY
          LOGO
REST in a nutshell:




   3. Cacheable
     SPEAKER‘S COMPANY
          LOGO
REST in a nutshell:




4. Layered system
      SPEAKER‘S COMPANY
           LOGO
REST in a nutshell:



                     5. Uniform
                     interface
     SPEAKER‘S COMPANY
          LOGO
And obviously nobody had a clue




                                  9




     SPEAKER‘S COMPANY
          LOGO
ANTIPATTERNS

                       10




   SPEAKER‘S COMPANY
        LOGO
1
     URIs
SPEAKER‘S COMPANY
     LOGO
"REST is about

       cool URI design"




http://apple.com/users/1/licenses/4.json




                            SPEAKER‘S COMPANY
                                  LOGO
"REST is about

       cool URI design"




http://apple.com/users/1/licenses/4.json




                            SPEAKER‘S COMPANY
                                  LOGO
http://apple.com/site/en_US/showUsers.jsp?uid=1&license=4




            is OK too
                  SPEAKER‘S COMPANY
                       LOGO
but




SPEAKER‘S COMPANY
     LOGO
cool URIs help you
think in term of resources
                            David Zuelke




        SPEAKER‘S COMPANY
             LOGO
2
URIs (bis)
SPEAKER‘S COMPANY
     LOGO
REST follows a URI schema


          GET /users
          POST /users
          PUT /users/{id}
          DELETE /users/{id}
          ...

        SPEAKER‘S COMPANY
             LOGO
REST follows a URI schema


          GET /users
          POST /users
          PUT /users/{id}
          DELETE /users/{id}
          ...

        SPEAKER‘S COMPANY
             LOGO
what if you change your
         URL?


       SPEAKER‘S COMPANY
            LOGO
Yeah,
client is
broken
  SPEAKER‘S COMPANY
       LOGO
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
HATEOAS
  SPEAKER‘S COMPANY
       LOGO
3
POST is cool

 SPEAKER‘S COMPANY
      LOGO
said SOAP

  SPEAKER‘S COMPANY
       LOGO
said SOAP

  SPEAKER‘S COMPANY
       LOGO
loosing meaningful verbs at the protocol level




              SPEAKER‘S COMPANY
                   LOGO
loosing meaningful verbs at the protocol level

        nothing cacheable by default




              SPEAKER‘S COMPANY
                   LOGO
loosing meaningful verbs at the protocol level

        nothing cacheable by default

         what about bookmarking?




              SPEAKER‘S COMPANY
                   LOGO
Have a break




                    30




SPEAKER‘S COMPANY
     LOGO
The WWW
                     31




 SPEAKER‘S COMPANY
      LOGO
the largest data-exchange network on the planet




                                                  32




            SPEAKER‘S COMPANY
                 LOGO
And meanwhile, at Facebook...



12TB of new data every day
       (1 year ago)

    500 million users               33




          SPEAKER‘S COMPANY
               LOGO
via   HTTP                , baby!




                                    34




      SPEAKER‘S COMPANY
           LOGO
HTTP in a nutshell:




1. Client <> Server
     SPEAKER‘S COMPANY
          LOGO
HTTP in a nutshell:




                 2. Stateless
     SPEAKER‘S COMPANY
          LOGO
HTTP in a nutshell:



3. widespread cache spec
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html


                  SPEAKER‘S COMPANY
                       LOGO
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
HTTP in a nutshell:




 5. it is the uniform interface
 between clients and servers
      SPEAKER‘S COMPANY
           LOGO
HTTP bleeds REST

                         40




     SPEAKER‘S COMPANY
          LOGO
Vol.2
            Implementing all this goodness




SPEAKER‘S COMPANY
     LOGO
1.
caching & scalability


     SPEAKER‘S COMPANY
          LOGO
Caching with
  Expiration

 SPEAKER‘S COMPANY
      LOGO
HTTP/1.1 200 OK
Host: www.example.com
Expires: 0




          SPEAKER‘S COMPANY
               LOGO
HTTP/1.1 200 OK
Host: www.example.com
Expires: 0




          SPEAKER‘S COMPANY
               LOGO
HTTP/1.1 200 OK
Host: www.example.com
Expires: Tue, 31 Jan 2011 01:00 GMT




           SPEAKER‘S COMPANY
                LOGO
HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: max-age=60, public




         SPEAKER‘S COMPANY
              LOGO
HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: max-age=60, public




         SPEAKER‘S COMPANY
              LOGO
HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: max-age=60, public


      Cacheable for 60 seconds



         SPEAKER‘S COMPANY
              LOGO
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
HTTP/1.1 200 OK
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600




                  SPEAKER‘S COMPANY
                        LOGO
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
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
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
Caching with
  Validation

 SPEAKER‘S COMPANY
      LOGO
HTTP/1.1 200 OK
Host: www.example.com
Etag: 1234




  SPEAKER‘S COMPANY
       LOGO
HTTP/1.1 200 OK
  Host: www.example.com
  Etag: 1234


an identifier for your response



     SPEAKER‘S COMPANY
          LOGO
Conditional requests

         GET / HTTP/1.1
         Host: www.example.com
         If-None-Match: 1234


the browsers asks you if it has been modified



             SPEAKER‘S COMPANY
                  LOGO
HTTP/1.1 304 Not Modified



       SPEAKER‘S COMPANY
            LOGO
Calculating an Etag is cheaper than generating a full MVC
                         response




                   SPEAKER‘S COMPANY
                        LOGO
but hey, you say




SPEAKER‘S COMPANY
     LOGO
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
Nope


 Nope

SPEAKER‘S COMPANY
     LOGO
ESI was built for that
  http://www.w3.org/TR/esi-lang




        SPEAKER‘S COMPANY
             LOGO
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
<esi:include src="http://jazoon.com/talks/1" />




               SPEAKER‘S COMPANY
                    LOGO
<esi:include src="http://jazoon.com/talks/1" />




               SPEAKER‘S COMPANY
                    LOGO
<esi:include src="http://jazoon.com/talks/1" />




               SPEAKER‘S COMPANY
                    LOGO
15 seconds cache




1 day cache

    SPEAKER‘S COMPANY
         LOGO
<esi:include src='tweets.html' />




<esi:include src='footer.html' />




               SPEAKER‘S COMPANY
                    LOGO
and hey, Varnish is a reverse proxy implementing what
           you need of the ESI specification

                  take 2, pay for 1




                 SPEAKER‘S COMPANY
                      LOGO
So what does HTTP cache is meant to solve?




            SPEAKER‘S COMPANY
                 LOGO
Less work

 SPEAKER‘S COMPANY
      LOGO
http://www.flickr.com/photos/snakphotography/5004775320/sizes/o/in/photostream/




  because the hard work is delegated to the browser/proxy


                                     SPEAKER‘S COMPANY
                                              LOGO
evolve

SPEAKER‘S COMPANY
     LOGO
because cache is abstracted from the application




              SPEAKER‘S COMPANY
                   LOGO
loose coupling

   SPEAKER‘S COMPANY
        LOGO
because caching is bound to the protocol, HTTP, not
to your implementation ( Sf, RoR, Django )




                       SPEAKER‘S COMPANY
                             LOGO
2.
adaptability & durability


       SPEAKER‘S COMPANY
            LOGO
Hypermedia
 another long-time friend




     SPEAKER‘S COMPANY
          LOGO
Links
outrageously semplifying




    SPEAKER‘S COMPANY
         LOGO
<link rel="payment" href="/checkout" type="text/html" ... />




                   SPEAKER‘S COMPANY
                        LOGO
<link rel="payment" href="/checkout" type="text/html" ... />




                   SPEAKER‘S COMPANY
                        LOGO
<link rel="payment" href="/checkout" type="text/html" ... />




                   SPEAKER‘S COMPANY
                        LOGO
<link rel="payment" href="/checkout" type="text/html" ... />




                   SPEAKER‘S COMPANY
                        LOGO
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
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
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
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
consumers of your API are able to follow
      the changes of your design




           SPEAKER‘S COMPANY
                LOGO
everything seems
      cool

But why REST?

    SPEAKER‘S COMPANY
         LOGO
Pros



Performances
  SPEAKER‘S COMPANY
       LOGO
Pros

Scalability

        SPEAKER‘S COMPANY
             LOGO
SPEAKER‘S COMPANY
     LOGO
Pros

                    Durability


SPEAKER‘S COMPANY
     LOGO
"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
Put a bit of
   REST
everywhere
   SPEAKER‘S COMPANY
        LOGO
Rules of
good design
   SPEAKER‘S COMPANY
        LOGO
Use natives
       =
Eliminate waste

   SPEAKER‘S COMPANY
        LOGO
The wheel!

HTTP - 1991~1997
  REST - 2000

    SPEAKER‘S COMPANY
         LOGO
Vol.3
                    REST is not a panacea




SPEAKER‘S COMPANY
     LOGO
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
AGILE
The last responsible moment conflicts with REST.

  But quality enhance agility: REST is quality.


           SPEAKER‘S COMPANY
                 LOGO
LIMITED
HORIZON
    My blog won't ever be RESTful.

But incremental design, bare it in mind.


       SPEAKER‘S COMPANY
             LOGO
Alessandro Nadalin               odino.org
DNSEE                            @_odino_
Rome                             github.com/odino




             SPEAKER‘S COMPANY
                  LOGO
Credits
      http://www.flickr.com/photos/larachris/16564077/sizes/o/in/photostream/
  http://www.flickr.com/photos/ashatenbroeke/4367373081/sizes/z/in/photostream/
     http://www.flickr.com/photos/yourdon/3140270189/sizes/l/in/photostream/
     http://www.flickr.com/photos/jox1989/4964706072/sizes/l/in/photostream/
      http://www.flickr.com/photos/brainfg/168506259/sizes/o/in/photostream/
     http://www.flickr.com/photos/norte_it/3897091546/sizes/o/in/photostream/
 http://www.zdnet.com/blog/service-oriented/soap-versus-rest-a-matter-of-style/3568
http://www.flickr.com/photos/turtlemom_nancy/2046347762/sizes/l/in/photostream/
      http://www.flickr.com/photos/juanpg/3333385784/sizes/z/in/photostream/
       http://www.flickr.com/photos/congvo/301678287/sizes/l/in/photostream/
     http://www.flickr.com/photos/ihasb33r/2573196546/sizes/z/in/photostream/
 http://www.flickr.com/photos/martin_heigan/4544138976/sizes/o/in/photostream/
      http://www.flickr.com/photos/cknara/4195099999/sizes/o/in/photostream/
      http://www.flickr.com/photos/1080p/3076529265/sizes/l/in/photostream/
     http://www.flickr.com/photos/adamrice/280300202/sizes/l/in/photostream/
      http://www.flickr.com/photos/tomer_a/541411897/sizes/o/in/photostream/
      http://www.flickr.com/photos/subpra/4514008262/sizes/l/in/photostream/
    http://www.flickr.com/photos/lippincott/2539720043/sizes/l/in/photostream/
     http://www.flickr.com/photos/rawryder/5086090931/sizes/l/in/photostream/
    http://www.flickr.com/photos/robboudon/5312731161/sizes/l/in/photostream/
 http://www.flickr.com/photos/bc-burnslibrary/4158243488/sizes/o/in/photostream/
http://www.flickr.com/photos/13606325@N08/2416993706/sizes/o/in/photostream/
    http://www.flickr.com/photos/neothezion/5135841069/sizes/l/in/photostream/
               http://www.flickr.com/photos/planetschwa/2494067809/
               http://www.flickr.com/photos/thomasthomas/258931782/
   http://www.flickr.com/photos/rustyboxcars/2629631562/sizes/l/in/photostream/
    http://www.flickr.com/photos/ell-r-brown/4138727474/sizes/l/in/photostream/
     http://www.flickr.com/photos/noah123/5082076630/sizes/z/in/photostream/
     http://www.flickr.com/photos/jungle_boy/220181177/sizes/l/in/photostream/
   http://www.flickr.com/photos/prettydaisies/872539081/sizes/l/in/photostream/
   http://www.flickr.com/photos/kaptainkobold/76256150/sizes/o/in/photostream/
 http://www.flickr.com/photos/uomoincravatta/1438372865/sizes/z/in/photostream/



                 SPEAKER‘S COMPANY
                            LOGO

More Related Content

Similar to REST in peace: a handbook of software waste @ Jazoon 2011 06-22-2011

Keeping it Snappy: Improving Website Performance
Keeping it Snappy: Improving Website PerformanceKeeping it Snappy: Improving Website Performance
Keeping it Snappy: Improving Website PerformanceM. Jackson Wilkinson
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and LicensesRobert Reiz
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?Alessandro Nadalin
 
Don't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apisDon't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apisAlessandro Cinelli (cirpo)
 
Release and-dependency-management memphis python
Release and-dependency-management memphis pythonRelease and-dependency-management memphis python
Release and-dependency-management memphis pythonJoe Ferguson
 
Agile Seaside
Agile SeasideAgile Seaside
Agile SeasideESUG
 
Seaside — Agile Software Development
Seaside — Agile Software DevelopmentSeaside — Agile Software Development
Seaside — Agile Software DevelopmentLukas Renggli
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Atlassian
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Atlassian
 
Building Rich Applications with Appcelerator
Building Rich Applications with AppceleratorBuilding Rich Applications with Appcelerator
Building Rich Applications with AppceleratorMatt Raible
 
The Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowAll Things Open
 
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...Baruch Sadogursky
 
Sail In The Cloud
Sail In The CloudSail In The Cloud
Sail In The CloudAlex Soto
 
A rough guide to JavaScript Performance
A rough guide to JavaScript PerformanceA rough guide to JavaScript Performance
A rough guide to JavaScript Performanceallmarkedup
 
JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza Batel Zohar Tova
 
Best Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion PipelinesBest Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion PipelinesAll Things Open
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 
Containerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesContainerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesAshley Roach
 

Similar to REST in peace: a handbook of software waste @ Jazoon 2011 06-22-2011 (20)

Keeping it Snappy: Improving Website Performance
Keeping it Snappy: Improving Website PerformanceKeeping it Snappy: Improving Website Performance
Keeping it Snappy: Improving Website Performance
 
CSG 2012
CSG 2012CSG 2012
CSG 2012
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and Licenses
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
 
Don't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apisDon't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apis
 
Release and-dependency-management memphis python
Release and-dependency-management memphis pythonRelease and-dependency-management memphis python
Release and-dependency-management memphis python
 
Agile Seaside
Agile SeasideAgile Seaside
Agile Seaside
 
Seaside — Agile Software Development
Seaside — Agile Software DevelopmentSeaside — Agile Software Development
Seaside — Agile Software Development
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
 
Building Rich Applications with Appcelerator
Building Rich Applications with AppceleratorBuilding Rich Applications with Appcelerator
Building Rich Applications with Appcelerator
 
Open sso fisl9.0
Open sso fisl9.0Open sso fisl9.0
Open sso fisl9.0
 
The Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To Know
 
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
 
Sail In The Cloud
Sail In The CloudSail In The Cloud
Sail In The Cloud
 
A rough guide to JavaScript Performance
A rough guide to JavaScript PerformanceA rough guide to JavaScript Performance
A rough guide to JavaScript Performance
 
JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza
 
Best Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion PipelinesBest Practices In Implementing Container Image Promotion Pipelines
Best Practices In Implementing Container Image Promotion Pipelines
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
Containerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesContainerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to Kubernetes
 

More from Alessandro Nadalin

Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...Alessandro Nadalin
 
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...Alessandro Nadalin
 
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017Alessandro Nadalin
 
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in DubaiAccelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in DubaiAlessandro Nadalin
 
React native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in RomeReact native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in RomeAlessandro Nadalin
 
Dockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in RomeDockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in RomeAlessandro Nadalin
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinAlessandro Nadalin
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Alessandro Nadalin
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Alessandro Nadalin
 
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...Alessandro Nadalin
 
A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013Alessandro Nadalin
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoAlessandro Nadalin
 
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...Alessandro Nadalin
 
The rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in TurinThe rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in TurinAlessandro Nadalin
 
GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012Alessandro Nadalin
 
The state of your own hypertext preprocessor
The state of your own hypertext preprocessorThe state of your own hypertext preprocessor
The state of your own hypertext preprocessorAlessandro Nadalin
 
REST in peace @ Osidays 2011 India 11-21-2011
REST in peace @ Osidays 2011 India 11-21-2011REST in peace @ Osidays 2011 India 11-21-2011
REST in peace @ Osidays 2011 India 11-21-2011Alessandro Nadalin
 
Got units? @ Osidays 2011 India 11-20-2011
Got units? @ Osidays 2011 India 11-20-2011Got units? @ Osidays 2011 India 11-20-2011
Got units? @ Osidays 2011 India 11-20-2011Alessandro Nadalin
 
Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011 Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011 Alessandro Nadalin
 

More from Alessandro Nadalin (20)

Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...
 
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
 
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
 
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in DubaiAccelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
 
React native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in RomeReact native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in Rome
 
Dockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in RomeDockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in Rome
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
 
Namshi in 2014: let's rock!
Namshi in 2014: let's rock!Namshi in 2014: let's rock!
Namshi in 2014: let's rock!
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
 
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
 
A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
 
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
 
The rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in TurinThe rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in Turin
 
GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012
 
The state of your own hypertext preprocessor
The state of your own hypertext preprocessorThe state of your own hypertext preprocessor
The state of your own hypertext preprocessor
 
REST in peace @ Osidays 2011 India 11-21-2011
REST in peace @ Osidays 2011 India 11-21-2011REST in peace @ Osidays 2011 India 11-21-2011
REST in peace @ Osidays 2011 India 11-21-2011
 
Got units? @ Osidays 2011 India 11-20-2011
Got units? @ Osidays 2011 India 11-20-2011Got units? @ Osidays 2011 India 11-20-2011
Got units? @ Osidays 2011 India 11-20-2011
 
Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011 Graph databases in PHP @ PHPCon Poland 10-22-2011
Graph databases in PHP @ PHPCon Poland 10-22-2011
 

Recently uploaded

DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfROWELL MARQUINA
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum ComputingGDSC PJATK
 
Dragino Technology LoRaWANデバイス、ゲートウェイ ユースケース
Dragino Technology   LoRaWANデバイス、ゲートウェイ ユースケースDragino Technology   LoRaWANデバイス、ゲートウェイ ユースケース
Dragino Technology LoRaWANデバイス、ゲートウェイ ユースケースCRI Japan, Inc.
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceMartin Humpolec
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Checklist to troubleshoot CD moisture profiles.docx
Checklist to troubleshoot CD moisture profiles.docxChecklist to troubleshoot CD moisture profiles.docx
Checklist to troubleshoot CD moisture profiles.docxNoman khan
 
ict grade 12 lesson 2 sinhala medium notes pdf
ict grade 12 lesson 2 sinhala medium notes pdfict grade 12 lesson 2 sinhala medium notes pdf
ict grade 12 lesson 2 sinhala medium notes pdfruhisiya9
 
LLM Threats: Prompt Injections and Jailbreak Attacks
LLM Threats: Prompt Injections and Jailbreak AttacksLLM Threats: Prompt Injections and Jailbreak Attacks
LLM Threats: Prompt Injections and Jailbreak AttacksThien Q. Tran
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfAna-Maria Mihalceanu
 
HHUG-03-2024-Impactful-Reporting-in-HubSpot.pptx
HHUG-03-2024-Impactful-Reporting-in-HubSpot.pptxHHUG-03-2024-Impactful-Reporting-in-HubSpot.pptx
HHUG-03-2024-Impactful-Reporting-in-HubSpot.pptxHampshireHUG
 
LinkedIn optimization Gunjan Dhir .pptx
LinkedIn optimization Gunjan Dhir .pptxLinkedIn optimization Gunjan Dhir .pptx
LinkedIn optimization Gunjan Dhir .pptxGunjan Dhir
 
ServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptxServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptxshyamraj55
 
IEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateIEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateHironori Washizaki
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...UiPathCommunity
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncObject Automation
 
Tracking license compliance made easy - intro to Grant (OSS)
Tracking license compliance made easy - intro to Grant (OSS)Tracking license compliance made easy - intro to Grant (OSS)
Tracking license compliance made easy - intro to Grant (OSS)Anchore
 

Recently uploaded (20)

DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum Computing
 
Dragino Technology LoRaWANデバイス、ゲートウェイ ユースケース
Dragino Technology   LoRaWANデバイス、ゲートウェイ ユースケースDragino Technology   LoRaWANデバイス、ゲートウェイ ユースケース
Dragino Technology LoRaWANデバイス、ゲートウェイ ユースケース
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your Salesforce
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Checklist to troubleshoot CD moisture profiles.docx
Checklist to troubleshoot CD moisture profiles.docxChecklist to troubleshoot CD moisture profiles.docx
Checklist to troubleshoot CD moisture profiles.docx
 
ict grade 12 lesson 2 sinhala medium notes pdf
ict grade 12 lesson 2 sinhala medium notes pdfict grade 12 lesson 2 sinhala medium notes pdf
ict grade 12 lesson 2 sinhala medium notes pdf
 
LLM Threats: Prompt Injections and Jailbreak Attacks
LLM Threats: Prompt Injections and Jailbreak AttacksLLM Threats: Prompt Injections and Jailbreak Attacks
LLM Threats: Prompt Injections and Jailbreak Attacks
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
 
HHUG-03-2024-Impactful-Reporting-in-HubSpot.pptx
HHUG-03-2024-Impactful-Reporting-in-HubSpot.pptxHHUG-03-2024-Impactful-Reporting-in-HubSpot.pptx
HHUG-03-2024-Impactful-Reporting-in-HubSpot.pptx
 
LinkedIn optimization Gunjan Dhir .pptx
LinkedIn optimization Gunjan Dhir .pptxLinkedIn optimization Gunjan Dhir .pptx
LinkedIn optimization Gunjan Dhir .pptx
 
ServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptxServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptx
 
IEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateIEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions Update
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...
 
GenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation IncGenAI and AI GCC State of AI_Object Automation Inc
GenAI and AI GCC State of AI_Object Automation Inc
 
Tracking license compliance made easy - intro to Grant (OSS)
Tracking license compliance made easy - intro to Grant (OSS)Tracking license compliance made easy - intro to Grant (OSS)
Tracking license compliance made easy - intro to Grant (OSS)
 

REST in peace: a handbook of software waste @ Jazoon 2011 06-22-2011

  • 1. REST in peace A handbook of software waste Alessandro Nadalin DNSEE 430 SPEAKER‘S COMPANY LOGO
  • 2. AGENDA > Vol. 1: REST in a nutshell > Vol. 2: To the rescue – Tenets – HTTP cache – Antipatterns – ESI > WWW: a tremendous architecture – HATEOAS – Stateless > Vol. 3: REST is not a panacea – Layered – SOAP – Cacheable – Limited horizon – Fault-tolerant – Agile development – Failure-prone 2 SPEAKER‘S COMPANY LOGO
  • 3. Sorry for the ugly slide. There will be others. Really sorry. SPEAKER‘S COMPANY LOGO
  • 4. REST in a nutshell: 1. Client <> Server SPEAKER‘S COMPANY LOGO
  • 5. REST in a nutshell: 2. Stateless SPEAKER‘S COMPANY LOGO
  • 6. REST in a nutshell: 3. Cacheable SPEAKER‘S COMPANY LOGO
  • 7. REST in a nutshell: 4. Layered system SPEAKER‘S COMPANY LOGO
  • 8. REST in a nutshell: 5. Uniform interface SPEAKER‘S COMPANY LOGO
  • 9. And obviously nobody had a clue 9 SPEAKER‘S COMPANY LOGO
  • 10. ANTIPATTERNS 10 SPEAKER‘S COMPANY LOGO
  • 11. 1 URIs SPEAKER‘S COMPANY LOGO
  • 12. "REST is about cool URI design" http://apple.com/users/1/licenses/4.json SPEAKER‘S COMPANY LOGO
  • 13. "REST is about cool URI design" http://apple.com/users/1/licenses/4.json SPEAKER‘S COMPANY LOGO
  • 14. http://apple.com/site/en_US/showUsers.jsp?uid=1&license=4 is OK too SPEAKER‘S COMPANY LOGO
  • 16. cool URIs help you think in term of resources David Zuelke SPEAKER‘S COMPANY LOGO
  • 18. REST follows a URI schema GET /users POST /users PUT /users/{id} DELETE /users/{id} ... SPEAKER‘S COMPANY LOGO
  • 19. REST follows a URI schema GET /users POST /users PUT /users/{id} DELETE /users/{id} ... SPEAKER‘S COMPANY LOGO
  • 20. what if you change your URL? SPEAKER‘S COMPANY LOGO
  • 21. Yeah, client is broken SPEAKER‘S COMPANY LOGO
  • 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
  • 23. HATEOAS SPEAKER‘S COMPANY LOGO
  • 24. 3 POST is cool SPEAKER‘S COMPANY LOGO
  • 25. said SOAP SPEAKER‘S COMPANY LOGO
  • 26. said SOAP SPEAKER‘S COMPANY LOGO
  • 27. loosing meaningful verbs at the protocol level SPEAKER‘S COMPANY LOGO
  • 28. loosing meaningful verbs at the protocol level nothing cacheable by default SPEAKER‘S COMPANY LOGO
  • 29. loosing meaningful verbs at the protocol level nothing cacheable by default what about bookmarking? SPEAKER‘S COMPANY LOGO
  • 30. Have a break 30 SPEAKER‘S COMPANY LOGO
  • 31. The WWW 31 SPEAKER‘S COMPANY LOGO
  • 32. the largest data-exchange network on the planet 32 SPEAKER‘S COMPANY LOGO
  • 33. And meanwhile, at Facebook... 12TB of new data every day (1 year ago) 500 million users 33 SPEAKER‘S COMPANY LOGO
  • 34. via HTTP , baby! 34 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
  • 40. HTTP bleeds REST 40 SPEAKER‘S COMPANY LOGO
  • 41. Vol.2 Implementing all this goodness SPEAKER‘S COMPANY LOGO
  • 42. 1. caching & scalability SPEAKER‘S COMPANY LOGO
  • 43. Caching with Expiration SPEAKER‘S COMPANY LOGO
  • 44. HTTP/1.1 200 OK Host: www.example.com Expires: 0 SPEAKER‘S COMPANY LOGO
  • 45. HTTP/1.1 200 OK Host: www.example.com Expires: 0 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
  • 55. Caching with Validation SPEAKER‘S COMPANY LOGO
  • 56. HTTP/1.1 200 OK Host: www.example.com Etag: 1234 SPEAKER‘S COMPANY LOGO
  • 57. HTTP/1.1 200 OK Host: www.example.com Etag: 1234 an identifier for your response SPEAKER‘S COMPANY LOGO
  • 58. Conditional requests GET / HTTP/1.1 Host: www.example.com If-None-Match: 1234 the browsers asks you if it has been modified SPEAKER‘S COMPANY LOGO
  • 59. HTTP/1.1 304 Not Modified SPEAKER‘S COMPANY LOGO
  • 60. Calculating an Etag is cheaper than generating a full MVC response SPEAKER‘S COMPANY LOGO
  • 61. but hey, you say 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
  • 69. 15 seconds cache 1 day cache SPEAKER‘S COMPANY LOGO
  • 70. <esi:include src='tweets.html' /> <esi:include src='footer.html' /> SPEAKER‘S COMPANY LOGO
  • 71. and hey, Varnish is a reverse proxy implementing what you need of the ESI specification take 2, pay for 1 SPEAKER‘S COMPANY LOGO
  • 72. So what does HTTP cache is meant to solve? SPEAKER‘S COMPANY LOGO
  • 73. Less work SPEAKER‘S COMPANY LOGO
  • 74. http://www.flickr.com/photos/snakphotography/5004775320/sizes/o/in/photostream/ because the hard work is delegated to the browser/proxy SPEAKER‘S COMPANY LOGO
  • 76. because cache is abstracted from the application SPEAKER‘S COMPANY LOGO
  • 77. loose coupling SPEAKER‘S COMPANY LOGO
  • 78. because caching is bound to the protocol, HTTP, not to your implementation ( Sf, RoR, Django ) SPEAKER‘S COMPANY LOGO
  • 79. 2. adaptability & durability SPEAKER‘S COMPANY LOGO
  • 80. Hypermedia another long-time friend SPEAKER‘S COMPANY LOGO
  • 81. Links outrageously semplifying SPEAKER‘S COMPANY LOGO
  • 82. <link rel="payment" href="/checkout" type="text/html" ... /> SPEAKER‘S COMPANY LOGO
  • 83. <link rel="payment" href="/checkout" type="text/html" ... /> SPEAKER‘S COMPANY LOGO
  • 84. <link rel="payment" href="/checkout" type="text/html" ... /> SPEAKER‘S COMPANY LOGO
  • 85. <link rel="payment" href="/checkout" type="text/html" ... /> 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
  • 91. everything seems cool But why REST? SPEAKER‘S COMPANY LOGO
  • 93. Pros Scalability SPEAKER‘S COMPANY LOGO
  • 95. Pros Durability 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
  • 98. Rules of good design SPEAKER‘S COMPANY LOGO
  • 99. Use natives = Eliminate waste SPEAKER‘S COMPANY LOGO
  • 100. The wheel! HTTP - 1991~1997 REST - 2000 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
  • 106. Credits http://www.flickr.com/photos/larachris/16564077/sizes/o/in/photostream/ http://www.flickr.com/photos/ashatenbroeke/4367373081/sizes/z/in/photostream/ http://www.flickr.com/photos/yourdon/3140270189/sizes/l/in/photostream/ http://www.flickr.com/photos/jox1989/4964706072/sizes/l/in/photostream/ http://www.flickr.com/photos/brainfg/168506259/sizes/o/in/photostream/ http://www.flickr.com/photos/norte_it/3897091546/sizes/o/in/photostream/ http://www.zdnet.com/blog/service-oriented/soap-versus-rest-a-matter-of-style/3568 http://www.flickr.com/photos/turtlemom_nancy/2046347762/sizes/l/in/photostream/ http://www.flickr.com/photos/juanpg/3333385784/sizes/z/in/photostream/ http://www.flickr.com/photos/congvo/301678287/sizes/l/in/photostream/ http://www.flickr.com/photos/ihasb33r/2573196546/sizes/z/in/photostream/ http://www.flickr.com/photos/martin_heigan/4544138976/sizes/o/in/photostream/ http://www.flickr.com/photos/cknara/4195099999/sizes/o/in/photostream/ http://www.flickr.com/photos/1080p/3076529265/sizes/l/in/photostream/ http://www.flickr.com/photos/adamrice/280300202/sizes/l/in/photostream/ http://www.flickr.com/photos/tomer_a/541411897/sizes/o/in/photostream/ http://www.flickr.com/photos/subpra/4514008262/sizes/l/in/photostream/ http://www.flickr.com/photos/lippincott/2539720043/sizes/l/in/photostream/ http://www.flickr.com/photos/rawryder/5086090931/sizes/l/in/photostream/ http://www.flickr.com/photos/robboudon/5312731161/sizes/l/in/photostream/ http://www.flickr.com/photos/bc-burnslibrary/4158243488/sizes/o/in/photostream/ http://www.flickr.com/photos/13606325@N08/2416993706/sizes/o/in/photostream/ http://www.flickr.com/photos/neothezion/5135841069/sizes/l/in/photostream/ http://www.flickr.com/photos/planetschwa/2494067809/ http://www.flickr.com/photos/thomasthomas/258931782/ http://www.flickr.com/photos/rustyboxcars/2629631562/sizes/l/in/photostream/ http://www.flickr.com/photos/ell-r-brown/4138727474/sizes/l/in/photostream/ http://www.flickr.com/photos/noah123/5082076630/sizes/z/in/photostream/ http://www.flickr.com/photos/jungle_boy/220181177/sizes/l/in/photostream/ http://www.flickr.com/photos/prettydaisies/872539081/sizes/l/in/photostream/ http://www.flickr.com/photos/kaptainkobold/76256150/sizes/o/in/photostream/ http://www.flickr.com/photos/uomoincravatta/1438372865/sizes/z/in/photostream/ SPEAKER‘S COMPANY LOGO