SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
The Rest of REST
                               Roy T. Fielding, Ph.D.

                               Chief Scientist, Day Software
                               V.P., Apache HTTP Server




                              http://roy.gbiv.com/talks/200709_fielding_rest.pdf
Tuesday, September 18, 2007
Between us, we cover all knowledge;
                              he knows all that can be known and I know the REST. [Mark Twain]



                                  Overview
         Representational State Transfer (REST)
            •    A little background
                 - WWW history + Roy history = REST context
                 - Why do we need a Web architectural style?
            •    A touch of theory
                 - Principled design
                 - Architectural properties
                 - Constraints that induce properties
            •    What parts of REST are missing from Ruby on Rails?

            •    Industry reactions to REST
                 - and a little bit of Relaxation
                                                                   2

Tuesday, September 18, 2007
Life's race will run, Life's work well done, Life's victory won,
                                 Now cometh REST. [Dr. Edward Hazen Parker]



                                     Why me?                                                                      Sep 07 = 135,166,473 (5,748x)

                                                                                                                                       23,517



             Using XMosaic




                                                                                                                                           EL
                                                              libwww-




                                                                                                                                       OD
                                                                 perl                               HTTP editor




                                                                                                                                       M
                                                                                                                                  CT
                                                                                                                                  JE
                                                                                                                              OB
                                                                          Relative
                              www.ics.uci.edu




                                                                                                                             TP
                                                                           URLs




                                                                                                                         HT
                                                                                                                        AS
                                                                                                                    NS
                                    wwwstat




                                                                                                                   GI
                                                                                                                  BE
                                                                                                              ST
                                                                                   HTML             10,022




                                                                                                             RE
                                                                                    2.0
                                         MOMspider                                                                      SJ IETF


                                                    Conditional                                     2nd WWW
                                                       GET
                                                                         2,738

                                                                                    1st WWW
                                              623
               130

               Jun 93                        Dec 93                       Jun 94                     Dec 94                                Jun 95
                                                        Public WWW servers [Matthew Gray]

                                                                           3

Tuesday, September 18, 2007
Absence of occupation is not REST,
                              A mind quite vacant is a mind distress'd. [William Cowper]



                                  The Problem (circa 1994)
         Early architecture was based on solid principles
            •    URLs, separation of concerns, simplicity
            •    lacked architectural description and rationale
         Protocols assumed a direct server connection
            •    no awareness of caching, proxies, or spiders
            •    many independent extensions
         Public awareness of the Web was just beginning
            •    exponential growth threatened the Internet
            •    commercialization meant new requirements and
                 new stakeholders
         A modern Web architecture was clearly needed
            •    but how do we avoid breaking the Web in the process?
                                                                     4

Tuesday, September 18, 2007
Everywhere I have sought REST and not found it, except
                              sitting in a corner by myself with a little book. [Thomas Kempis]



                                  Software Architectures
         A software architecture is an abstraction of the run-
         time elements of a software system during some
         phase of its operation. A system may be composed
         of many levels of abstraction and many phases of
         operation, each with its own software architecture.
            •    A software architecture is defined by a configuration of
                 architectural elements—components, connectors, and
                 data—constrained in their relationships in order to achieve
                 a desired set of architectural properties.
            •    A configuration is the structure of architectural relationships
                 among components, connectors, and data during a period
                 of system run-time.


                                                                      5

Tuesday, September 18, 2007
Da requiem; requietus ager bene credita reddit. [Ovid]
                              (Take REST; a field that has RESTed gives a bountiful crop.)



                                  Architectural Styles
         An architectural style is a coordinated set of
         architectural constraints that restricts the roles and
         features of architectural elements, and the allowed
         relationships among those elements, within any
         architecture that conforms to that style.
            •    A style can be applied to many architectures
            •    An architecture can consist of many styles
         Design at the right level of abstraction
            •    Styles help architects communicate architecture
            •    Architecture determines potential system properties
            •    Implementation determines actual system properties
            •    Architectural patterns are styles with common recipes

                                                                     6

Tuesday, September 18, 2007
Oh, some seek bread--no more--life's mere subsistence, ...




                                  What is the Web, really?
                                                                                           Information



                                  Browsers




                                                                                                Protocols

                                                                     7

Tuesday, September 18, 2007
... And some seek wealth and ease--the common quest; ...




                                  Web Implementation




                                                                    8

Tuesday, September 18, 2007
... And some seek fame, that hovers in the distance; ...




                                  Web Architecture
         One abstraction level above the implementation

         Components
            •    User agents, Intermediaries, Servers
            •    Browsers, Spiders, Proxies, Gateways, Origin Servers
         Connectors
            •    HTTP: a standard transfer protocol to prefer over many
         Data
            •    URI: one identifier standard for all resources
            •    HTML, XML, RDF, ...: common representation formats to
                 describe and bind resources


                                                                       9

Tuesday, September 18, 2007
... But all are seeking REST.
                              [Rev. Frederick Langbridge]



                                  Web Architectural Style
         One abstraction level above Architecture
            •    two abstraction levels above implementation
            •    that’s one too many for most folks
         An architectural style is a set of constraints
            •    unfortunately, constraints are hard to visualize
                 - kind of like gravity or electromagnetism
                 - observed only by their effect on others
         Constraints induce architectural properties
            •    both desirable and undesirable properties
                 - a.k.a., software qualities
                 - a.k.a., design trade-offs
                                                              10

Tuesday, September 18, 2007
REST is not quitting the busy career;
                              REST is the fitting of self to its sphere. [John Sullivan Dwight]



                                  Web Requirements
         Low entry barrier
                 - Hypermedia User Interface
                 - Simple protocols for authoring and data transfer
            •    a.k.a., must be Simple, Reusable, and Extensible
         Distributed Hypermedia System
                 - Large data transfers
                 - Sensitive to user-perceived latency
            •    a.k.a., must be Data-driven, Streamable, and Cacheable
         Multiple organizational boundaries
                 - Anarchic scalability
                 - Gradual and fragmented change (deployment)
            •    a.k.a, must be Scalable, Evolvable, Visible, Reliable, ...

                                                                       11

Tuesday, September 18, 2007
Sometimes the most urgent and vital thing you can possibly do
                              is take a complete REST. [Ashleigh Brilliant]



                                  REST on a slide

                                                                               pro




                                                                     layered
                                                                                     gra
                         replicated                                                        mm                uniform interface
                                                                                                abl
                                                separated                                          e
                  RR                      CS                       LS                                  VM            U
                                                   i nt
                                                  pr erme
                                                     oc d
  on-demand                      stateless              es iat                       mobile                              simple
                                                          sin e
                                                                                                                         visible
                                                             g
                    $                    CSS                      LCS                                  COD

                                                                                                             reusable
                                  reliable                  shared                     extensible
                          cacheable                scalable             multi-
                                         C$SS                     LC$SS org. LCODC$SS                              REST


                                      Figure 5-9. REST Derivation by Style Constraints


the disadvantages) of the optional constraints12when they are known to be in effect for some
Tuesday, September 18, 2007
How beautiful it is to do nothing,
                              and then REST afterward. [Spanish Proverb]



                                  Style = nil

                  Starting from a condition of no constraints…




                                                      WWW



                                                                   13

Tuesday, September 18, 2007
REST is not idleness, ...




                                  Style += Client/Server

                    Apply separation of concerns: Client-Server




              improves UI portability                              simplifies server


                                          enables multiple organizational domains



                                                            14

Tuesday, September 18, 2007
... and to lie sometimes on the grass ...




                                   Style += Stateless

                              Constrain interaction to be stateless…




                                                                                simplifies server

                       degrades efficiency                                      improves scalability

                                                                                improves reliability


                                                                           15

Tuesday, September 18, 2007
... under the trees on a summer's day, ...




                                  Style += Caching

                               Add optional non-shared caching


                                               $




                                               $

                                                                            reduces average latency

                       degrades reliability                                 improves efficiency

                                                                            improves scalability


                                                                       16

Tuesday, September 18, 2007
... listening to the murmur of water, ...




                                  Style += Uniform Interface

                     Apply generality: uniform interface constraint


                                               $



                                                                                $



                                                $

                                                                               improves visibility

                       degrades efficiency                                          independent evolvability

                                                                               decouples implementation


                                                                          17

Tuesday, September 18, 2007
... or watching the clouds float across the sky, ...




                                  Style += Layered System

                   Apply info hiding: layered system constraints

                                                                                            $
                                       $

                    $


                                           $                                                         $
                    $




                                        $                                      $



                  adds latency                 shared caching                      legacy encapsulation

              simplifies clients                     improves scalability                         load balancing

                                                                        18

Tuesday, September 18, 2007
... is by no means a waste of time. [Sir John Lubbock]




                                  REST Style

                        Finally, allow code-on-demand (applets/js)


                                                                                       $
                                      $

                    $


                                          $                                                     $
                    $




                                       $                                   $




              simplifies clients                      improves extensibility               reduces visibility

                                                                     19

Tuesday, September 18, 2007
REST Uniform Interface
         All important resources are identified by one
         resource identifier mechanism
                 - simple, visible, reusable, stateless communication
         Access methods (actions) mean the same for all
         resources (universal semantics)
                 - layered system, cacheable, and shared caches
         Resources are manipulated through
         the exchange of representations
                 - simple, visible, reusable, cacheable, and
                        stateless communication
         Exchanges occur in self-descriptive messages
                 - layered system, cacheable, and shared caches
                                                  20

Tuesday, September 18, 2007
REST Uniform Interface
         Hypertext as the engine of application state
            •    A successful response indicates (or contains) a current
                 representation of the state of the identified resource;
                 the resource remains hidden behind the server interface.
            •    Some representations contain links to potential next
                 application states, including direction on how to transition
                 to those states when a transition is selected.
            •    Each steady-state (Web page) embodies
                 the current application state
                     - simple, visible, scalable, reliable, reusable, and
                       cacheable network-based applications
            •    All application state (not resource state) is kept on client
            •    All shared state (not session state) is kept on origin server

                                             21

Tuesday, September 18, 2007
Hypertext Clarification
         Hypertext has many (old) definitions
          • quot;By 'hypertext,' I mean non-sequential writing — text that branches and allows
                 choices to the reader, best read at an interactive screen. As popularly conceived,
                 this is a series of text chunks connected by links which offer the reader different
                 pathwaysquot; [Theodor H. Nelson]
            •    “Hypertext is a computer-supported medium for information in which many
                 interlinked documents are displayed with their links on a high-resolution
                 computer screen.” [Jeffrey Conklin]

         When I say Hypertext, I mean ...
            •    The simultaneous presentation of information and controls
                 such that the information becomes the affordance through
                 which the user obtains choices and selects actions.
            •    Hypertext does not need to be HTML on a browser
                 - machines can follow links when they understand
                    the data format and relationship types
                                                       22

Tuesday, September 18, 2007
REST Rationale
         Maximizes reuse
            •    uniform resources having identifiers = Bigger WWW
            •    visibility results in serendipity
         Minimizes coupling to enable evolution
            •    uniform interface hides all implementation details
            •    hypertext allows late-binding of application control-flow
            •    gradual and fragmented change across organizations
         Eliminates partial failure conditions
            •    server failure does not befuddle client state
            •    shared state is recoverable as a resource
         Scales without bound
            •    services can be layered, clustered, and cached
         Simplifies, simplifies, simplifies
                                              23

Tuesday, September 18, 2007
REST when you're weary. Refresh and renew yourself, your body,
                              your mind, your spirit. Then get back to work. [Ralph Marston]



                                  What is missing from Rails?
         Just newbie speculation, without looking at edge:
         Uniform method semantics?
            •    Rails support (via CRUD) is outstanding
            •    but what happens when I add a new HTTP method?
         Resource identifiers for important resources?
            •    Route configs are good, but code-structure dependent
            •    URI templates would be better, IMO
         Resources manipulated as representations?
            •    Rails has excellent support for alternative data formats
         Hypertext as the engine of application state?
            •    Is this just assumed? Can it be guided by Rails?

                                                                  24

Tuesday, September 18, 2007
A little relaxation
                               Roy T. Fielding, Ph.D.

                               Chief Scientist, Day Software
                               V.P., Apache HTTP Server




                              http://roy.gbiv.com/talks/200709_fielding_rest.pdf
Tuesday, September 18, 2007
Client:    Excuse me. Did you say knives?
                              Architect: Rotating knives, yes. [Monty Python’s Flying Circus]



                                  Industry Practice
         Meanwhile, in a parallel universe ...
            •    http://www.youtube.com/watch?v=-RxhkWLJH4Y
            •    Microsoft was selling COM+/DCOM
            •    IBM and friends were selling CORBA
            •    Sun was selling RMI
            •    W3C was developing XML
         Then SOAP was dropped on the shower floor
         as an Internet Draft
            •    and quickly laughed out of the IETF
            •    only to be picked up by IBM and renamed “Web Services”
         and REST became the only counter-argument
         to multi-billions in advertising
                                                                   26

Tuesday, September 18, 2007
Cast off the cares that have so long oppressed;
                              REST, sweetly REST! [Jane Laurie Borthwick]



                                  Industry Reaction?
         Not very constructive
            •    proponents labeled as RESTafarians
            •    arguments derided as a “religion”
            •    excused as “too simple for real services”
         Service-Oriented Architecture (SOA)
            •    a direct response to REST
            •    attempt at an architectural style for WS
                 - without any constraints
            •    What is SOA?
                 - Wardrobe, Musical Notes, or Legos?
                 - http://www.youtube.com/profile_videos?
                    user=richneckyogi

                                                                    27

Tuesday, September 18, 2007
REST is sweet after strife. [Lord Edward Robert Bulwer Lytton]




                                  Industry Acceptance
         Something has changed ...
            •    People started to talk about the value of URIs
                 (reusable resources)
            •    Google maps decided to encourage reuse (Mashups)
            •    O’Reilly began talking about Web 2.0
            •    Rails reminded people that frameworks can be simple

         and REST(ful) became the next industry buzzword


                                                        Yikes!

                                                                    28

Tuesday, September 18, 2007
Men, in whatever anxiety they may be, if they are men,
                              sometimes indulge in relaxation. [Marcus Tullius Cicero]



                                  Relaxation
         Clearly, it’s time to start messing with minds
            •    REST is not the only architectural style
            •    My dissertation is about Principled Design,
                 not the one true architecture
         What do constraints really mean?
            •    codify a design choice at the level of architecture
            •    to induce certain (good) architectural properties
            •    at the expense of certain (bad) trade-offs
         What happens when we relax a given constraint?
            •    Is it really the end of the world?
            •    Should waka (a replacement for HTTP) have its own style?


                                                                    29

Tuesday, September 18, 2007
Relax uniform methods ?
         What happens when we let the interface be
         resource-specific?
            •    URI is no longer sufficient for resource identification
                 - lose benefit of URI exchange (assumed GET)
                 - require resource description language
            •    Information becomes segregated by resource type
                 - walled into gardens (loss of power laws / pagerank)
                 - important information must be replicated
            •    Intermediaries cannot encapsulate services
                 - unable to anticipate resource behavior
                 - too complex to cache based on method semantics
            •    No more serendipity

                                             30

Tuesday, September 18, 2007
For too much REST itself becomes a pain.
                              [Homer, The Odyssey]



                                  Relax client/server ?
         What happens when we let servers make requests?
            •    lose implementation simplicity due to listening,
                 additional parsing requirements
            •    potential for confusion with mixed-protocol intermediaries
            •    unknown: does it impact session state?
         Trade-offs aren’t as severe as the first example.
         Benefits?
            •    peer-to-peer applications
            •    shared cache mesh, triggered expiration
         Can we find ways to compensate for the trade-offs?
            •    Make message syntax more uniform
                 - Limit server-initiated requests to same-connection
                                                                   31

Tuesday, September 18, 2007
Let the weary at length possess quiet REST.
                              [Lucius Annaeus Seneca]



                                  Conclusion
         Use your brains!
            •    don’t design-by-buzzword
            •    don’t believe everything you read
            •    always keep in mind that change is inevitable
            •    use principled design
                 - identify desired architectural properties
                 - constrain behavior to induce properties
                 - compensate for the inevitable design trade-offs




                                                                   32

Tuesday, September 18, 2007

Contenu connexe

Plus de guest6850dd

Plus de guest6850dd (6)

Speech Upward Slope
Speech   Upward SlopeSpeech   Upward Slope
Speech Upward Slope
 
cars
carscars
cars
 
cars
carscars
cars
 
re7jweiss
re7jweissre7jweiss
re7jweiss
 
re7jenskramer
re7jenskramerre7jenskramer
re7jenskramer
 
re7olabini
re7olabinire7olabini
re7olabini
 

Dernier

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 

Dernier (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 

re7royfielding

  • 1. The Rest of REST Roy T. Fielding, Ph.D. Chief Scientist, Day Software V.P., Apache HTTP Server http://roy.gbiv.com/talks/200709_fielding_rest.pdf Tuesday, September 18, 2007
  • 2. Between us, we cover all knowledge; he knows all that can be known and I know the REST. [Mark Twain] Overview Representational State Transfer (REST) • A little background - WWW history + Roy history = REST context - Why do we need a Web architectural style? • A touch of theory - Principled design - Architectural properties - Constraints that induce properties • What parts of REST are missing from Ruby on Rails? • Industry reactions to REST - and a little bit of Relaxation 2 Tuesday, September 18, 2007
  • 3. Life's race will run, Life's work well done, Life's victory won, Now cometh REST. [Dr. Edward Hazen Parker] Why me? Sep 07 = 135,166,473 (5,748x) 23,517 Using XMosaic EL libwww- OD perl HTTP editor M CT JE OB Relative www.ics.uci.edu TP URLs HT AS NS wwwstat GI BE ST HTML 10,022 RE 2.0 MOMspider SJ IETF Conditional 2nd WWW GET 2,738 1st WWW 623 130 Jun 93 Dec 93 Jun 94 Dec 94 Jun 95 Public WWW servers [Matthew Gray] 3 Tuesday, September 18, 2007
  • 4. Absence of occupation is not REST, A mind quite vacant is a mind distress'd. [William Cowper] The Problem (circa 1994) Early architecture was based on solid principles • URLs, separation of concerns, simplicity • lacked architectural description and rationale Protocols assumed a direct server connection • no awareness of caching, proxies, or spiders • many independent extensions Public awareness of the Web was just beginning • exponential growth threatened the Internet • commercialization meant new requirements and new stakeholders A modern Web architecture was clearly needed • but how do we avoid breaking the Web in the process? 4 Tuesday, September 18, 2007
  • 5. Everywhere I have sought REST and not found it, except sitting in a corner by myself with a little book. [Thomas Kempis] Software Architectures A software architecture is an abstraction of the run- time elements of a software system during some phase of its operation. A system may be composed of many levels of abstraction and many phases of operation, each with its own software architecture. • A software architecture is defined by a configuration of architectural elements—components, connectors, and data—constrained in their relationships in order to achieve a desired set of architectural properties. • A configuration is the structure of architectural relationships among components, connectors, and data during a period of system run-time. 5 Tuesday, September 18, 2007
  • 6. Da requiem; requietus ager bene credita reddit. [Ovid] (Take REST; a field that has RESTed gives a bountiful crop.) Architectural Styles An architectural style is a coordinated set of architectural constraints that restricts the roles and features of architectural elements, and the allowed relationships among those elements, within any architecture that conforms to that style. • A style can be applied to many architectures • An architecture can consist of many styles Design at the right level of abstraction • Styles help architects communicate architecture • Architecture determines potential system properties • Implementation determines actual system properties • Architectural patterns are styles with common recipes 6 Tuesday, September 18, 2007
  • 7. Oh, some seek bread--no more--life's mere subsistence, ... What is the Web, really? Information Browsers Protocols 7 Tuesday, September 18, 2007
  • 8. ... And some seek wealth and ease--the common quest; ... Web Implementation 8 Tuesday, September 18, 2007
  • 9. ... And some seek fame, that hovers in the distance; ... Web Architecture One abstraction level above the implementation Components • User agents, Intermediaries, Servers • Browsers, Spiders, Proxies, Gateways, Origin Servers Connectors • HTTP: a standard transfer protocol to prefer over many Data • URI: one identifier standard for all resources • HTML, XML, RDF, ...: common representation formats to describe and bind resources 9 Tuesday, September 18, 2007
  • 10. ... But all are seeking REST. [Rev. Frederick Langbridge] Web Architectural Style One abstraction level above Architecture • two abstraction levels above implementation • that’s one too many for most folks An architectural style is a set of constraints • unfortunately, constraints are hard to visualize - kind of like gravity or electromagnetism - observed only by their effect on others Constraints induce architectural properties • both desirable and undesirable properties - a.k.a., software qualities - a.k.a., design trade-offs 10 Tuesday, September 18, 2007
  • 11. REST is not quitting the busy career; REST is the fitting of self to its sphere. [John Sullivan Dwight] Web Requirements Low entry barrier - Hypermedia User Interface - Simple protocols for authoring and data transfer • a.k.a., must be Simple, Reusable, and Extensible Distributed Hypermedia System - Large data transfers - Sensitive to user-perceived latency • a.k.a., must be Data-driven, Streamable, and Cacheable Multiple organizational boundaries - Anarchic scalability - Gradual and fragmented change (deployment) • a.k.a, must be Scalable, Evolvable, Visible, Reliable, ... 11 Tuesday, September 18, 2007
  • 12. Sometimes the most urgent and vital thing you can possibly do is take a complete REST. [Ashleigh Brilliant] REST on a slide pro layered gra replicated mm uniform interface abl separated e RR CS LS VM U i nt pr erme oc d on-demand stateless es iat mobile simple sin e visible g $ CSS LCS COD reusable reliable shared extensible cacheable scalable multi- C$SS LC$SS org. LCODC$SS REST Figure 5-9. REST Derivation by Style Constraints the disadvantages) of the optional constraints12when they are known to be in effect for some Tuesday, September 18, 2007
  • 13. How beautiful it is to do nothing, and then REST afterward. [Spanish Proverb] Style = nil Starting from a condition of no constraints… WWW 13 Tuesday, September 18, 2007
  • 14. REST is not idleness, ... Style += Client/Server Apply separation of concerns: Client-Server improves UI portability simplifies server enables multiple organizational domains 14 Tuesday, September 18, 2007
  • 15. ... and to lie sometimes on the grass ... Style += Stateless Constrain interaction to be stateless… simplifies server degrades efficiency improves scalability improves reliability 15 Tuesday, September 18, 2007
  • 16. ... under the trees on a summer's day, ... Style += Caching Add optional non-shared caching $ $ reduces average latency degrades reliability improves efficiency improves scalability 16 Tuesday, September 18, 2007
  • 17. ... listening to the murmur of water, ... Style += Uniform Interface Apply generality: uniform interface constraint $ $ $ improves visibility degrades efficiency independent evolvability decouples implementation 17 Tuesday, September 18, 2007
  • 18. ... or watching the clouds float across the sky, ... Style += Layered System Apply info hiding: layered system constraints $ $ $ $ $ $ $ $ adds latency shared caching legacy encapsulation simplifies clients improves scalability load balancing 18 Tuesday, September 18, 2007
  • 19. ... is by no means a waste of time. [Sir John Lubbock] REST Style Finally, allow code-on-demand (applets/js) $ $ $ $ $ $ $ $ simplifies clients improves extensibility reduces visibility 19 Tuesday, September 18, 2007
  • 20. REST Uniform Interface All important resources are identified by one resource identifier mechanism - simple, visible, reusable, stateless communication Access methods (actions) mean the same for all resources (universal semantics) - layered system, cacheable, and shared caches Resources are manipulated through the exchange of representations - simple, visible, reusable, cacheable, and stateless communication Exchanges occur in self-descriptive messages - layered system, cacheable, and shared caches 20 Tuesday, September 18, 2007
  • 21. REST Uniform Interface Hypertext as the engine of application state • A successful response indicates (or contains) a current representation of the state of the identified resource; the resource remains hidden behind the server interface. • Some representations contain links to potential next application states, including direction on how to transition to those states when a transition is selected. • Each steady-state (Web page) embodies the current application state - simple, visible, scalable, reliable, reusable, and cacheable network-based applications • All application state (not resource state) is kept on client • All shared state (not session state) is kept on origin server 21 Tuesday, September 18, 2007
  • 22. Hypertext Clarification Hypertext has many (old) definitions • quot;By 'hypertext,' I mean non-sequential writing — text that branches and allows choices to the reader, best read at an interactive screen. As popularly conceived, this is a series of text chunks connected by links which offer the reader different pathwaysquot; [Theodor H. Nelson] • “Hypertext is a computer-supported medium for information in which many interlinked documents are displayed with their links on a high-resolution computer screen.” [Jeffrey Conklin] When I say Hypertext, I mean ... • The simultaneous presentation of information and controls such that the information becomes the affordance through which the user obtains choices and selects actions. • Hypertext does not need to be HTML on a browser - machines can follow links when they understand the data format and relationship types 22 Tuesday, September 18, 2007
  • 23. REST Rationale Maximizes reuse • uniform resources having identifiers = Bigger WWW • visibility results in serendipity Minimizes coupling to enable evolution • uniform interface hides all implementation details • hypertext allows late-binding of application control-flow • gradual and fragmented change across organizations Eliminates partial failure conditions • server failure does not befuddle client state • shared state is recoverable as a resource Scales without bound • services can be layered, clustered, and cached Simplifies, simplifies, simplifies 23 Tuesday, September 18, 2007
  • 24. REST when you're weary. Refresh and renew yourself, your body, your mind, your spirit. Then get back to work. [Ralph Marston] What is missing from Rails? Just newbie speculation, without looking at edge: Uniform method semantics? • Rails support (via CRUD) is outstanding • but what happens when I add a new HTTP method? Resource identifiers for important resources? • Route configs are good, but code-structure dependent • URI templates would be better, IMO Resources manipulated as representations? • Rails has excellent support for alternative data formats Hypertext as the engine of application state? • Is this just assumed? Can it be guided by Rails? 24 Tuesday, September 18, 2007
  • 25. A little relaxation Roy T. Fielding, Ph.D. Chief Scientist, Day Software V.P., Apache HTTP Server http://roy.gbiv.com/talks/200709_fielding_rest.pdf Tuesday, September 18, 2007
  • 26. Client: Excuse me. Did you say knives? Architect: Rotating knives, yes. [Monty Python’s Flying Circus] Industry Practice Meanwhile, in a parallel universe ... • http://www.youtube.com/watch?v=-RxhkWLJH4Y • Microsoft was selling COM+/DCOM • IBM and friends were selling CORBA • Sun was selling RMI • W3C was developing XML Then SOAP was dropped on the shower floor as an Internet Draft • and quickly laughed out of the IETF • only to be picked up by IBM and renamed “Web Services” and REST became the only counter-argument to multi-billions in advertising 26 Tuesday, September 18, 2007
  • 27. Cast off the cares that have so long oppressed; REST, sweetly REST! [Jane Laurie Borthwick] Industry Reaction? Not very constructive • proponents labeled as RESTafarians • arguments derided as a “religion” • excused as “too simple for real services” Service-Oriented Architecture (SOA) • a direct response to REST • attempt at an architectural style for WS - without any constraints • What is SOA? - Wardrobe, Musical Notes, or Legos? - http://www.youtube.com/profile_videos? user=richneckyogi 27 Tuesday, September 18, 2007
  • 28. REST is sweet after strife. [Lord Edward Robert Bulwer Lytton] Industry Acceptance Something has changed ... • People started to talk about the value of URIs (reusable resources) • Google maps decided to encourage reuse (Mashups) • O’Reilly began talking about Web 2.0 • Rails reminded people that frameworks can be simple and REST(ful) became the next industry buzzword Yikes! 28 Tuesday, September 18, 2007
  • 29. Men, in whatever anxiety they may be, if they are men, sometimes indulge in relaxation. [Marcus Tullius Cicero] Relaxation Clearly, it’s time to start messing with minds • REST is not the only architectural style • My dissertation is about Principled Design, not the one true architecture What do constraints really mean? • codify a design choice at the level of architecture • to induce certain (good) architectural properties • at the expense of certain (bad) trade-offs What happens when we relax a given constraint? • Is it really the end of the world? • Should waka (a replacement for HTTP) have its own style? 29 Tuesday, September 18, 2007
  • 30. Relax uniform methods ? What happens when we let the interface be resource-specific? • URI is no longer sufficient for resource identification - lose benefit of URI exchange (assumed GET) - require resource description language • Information becomes segregated by resource type - walled into gardens (loss of power laws / pagerank) - important information must be replicated • Intermediaries cannot encapsulate services - unable to anticipate resource behavior - too complex to cache based on method semantics • No more serendipity 30 Tuesday, September 18, 2007
  • 31. For too much REST itself becomes a pain. [Homer, The Odyssey] Relax client/server ? What happens when we let servers make requests? • lose implementation simplicity due to listening, additional parsing requirements • potential for confusion with mixed-protocol intermediaries • unknown: does it impact session state? Trade-offs aren’t as severe as the first example. Benefits? • peer-to-peer applications • shared cache mesh, triggered expiration Can we find ways to compensate for the trade-offs? • Make message syntax more uniform - Limit server-initiated requests to same-connection 31 Tuesday, September 18, 2007
  • 32. Let the weary at length possess quiet REST. [Lucius Annaeus Seneca] Conclusion Use your brains! • don’t design-by-buzzword • don’t believe everything you read • always keep in mind that change is inevitable • use principled design - identify desired architectural properties - constrain behavior to induce properties - compensate for the inevitable design trade-offs 32 Tuesday, September 18, 2007