SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
REST, Reuse, and
  Serendipity
       Steve Vinoski
    Member of Technical Staff
           Verivue
      Westford, MA USA
      QCon London 2008
serendipity (noun): the
occurrence and development
of events by chance in a
happy or beneficial way.
Motivation
•   Many folks in the web world already
    understand the capabilities and power of REST

    •   if this describes you, this talk may bore you

•   But to many involved in enterprise integration
    and middleware, REST is entirely new and
    misunderstood

    •   this talk is for you
Enterprise Integration
Some Solutions
•   Descendants of Remote Procedure Call (RPC)

    •   CORBA, EJB, .NET, SCA

    •   SOAP, WSDL, WS-*

•   Enterprise messaging

    •   Messaging queuing

    •   Enterprise Application Integration (EAI)
Problems with MQ

• Generally proprietary, except for:
 • JMS: open messaging interfaces
 • AMQP: open messaging protocol (and
    open source Apache implementation)
• Can be expensive
Problems with EAI
• EAI systems are typically:
 • proprietary and expensive
 • centralized hubs
 • costly to customize and maintain
• Some ESBs have fallen into this category
 • old EAI products re-labeled
Problems with RPC
     Approaches
• Focus on language first
 • tries to fit the distributed system to the
    language, not vice-versa
• Tries to make distributed calls appear local
 • ignores partial failure and latency issues
• Exposes language-specific objects directly
  as language-independent services
More RPC Problems
• Code generation
 • traditionally, stub code generated from a
    definition language, e.g. IDL or WSDL
  • today WSDL is often reverse-generated
    from annotated language definitions
• Both approaches can create deceptively
  significant consumer-service coupling
Type System Illusions
• RPC-oriented systems offer the illusion of
  type safety
  • define interface types
  • define data types to pass via methods
• But there is no type safety across the wire
• This type specialization is costly for
  scalability and reuse
Interfaces are Protocols
• In RPC-oriented systems, a new service
  interface is a new application protocol
 • consumers hard-code knowledge of
    method names and semantics
 • consumers must inherently know which
    method to call, possibly in what order
 • no semantic constraints on methods
Data Specialization
• RPC-oriented systems encourage
  specialized data definitions
 • same as defining regular classes/methods
• Using XML is better than using IDL types
  or programming language types
 • but benefits disappear if you generate
    code from it
Integration Problem
       Summary
• Proprietary approaches too expensive
• Standard approaches focus on
  implementation languages, not distributed
  systems issues
• New interface == new application protocol
• Ad hoc data formats coupled to interfaces
• All these problems inhibit reuse
A Detour: UNIX Reuse
• Consider the UNIX shell pipe
 • chain output of one tool to input of
    another
 • old tools and new can interact, even
    though independently developed
 • easily combine existing tools into new
    ones
UNIX Pipes
•   The pipe is based on two key features

    •   the uniform interface of the “file-like object”

    •   the standard file descriptor framework for
        applications: stdin, stdout, stderr

•   Standard ways to get data to/from applications

•   The pipe results from modularity and simplicity
    (and serendipity, perhaps?)
REST’s Uniform
  Interface Constraint
• Generalized resource interface
 • in HTTP, methods are the protocol verbs
  Method          Purpose              Idempotent?
    GET      Retrieve resource state         Yes
                 representation         (no side effects)
             Provide resource state
    PUT          representation
                                             Yes
              Create or extend a
   POST             resource
                                             No

  DELETE       Delete a resource             Yes
Uniform Interface
         Benefits
• Enables visibility into interactions
 • including caching, monitoring, mediation
    applicable across all resources
• Provides strong implementation hiding,
  independent evolvability
• Simplified overall architecture
Generic Invocation
•   The uniform interface makes reusable generic
    invocation libraries possible
    •   python urllib, urllib2, httplib, httplib2
    •   curl command-line tool
    •   many others, in many languages
•   Server-side dispatching simplified as well
•   No need for generated code
Four Sub-Constraints
• Resource identification via URIs
• Resource manipulation through the
  exchange of resource state representations
• Self-describing messages with potentially
  multiple representation formats
• Hypermedia as the engine of application
  state (HATEOAS, or hypermedia constraint)
Representations

• Method payloads are representations of
  resource state
• Methods often support multiple
  representation formats
• Representation format is not method-
  specific as with RPC-oriented approaches
Media Types
• Representation formats identified using
  media (MIME) types
• These types are standardized/registered
  through the IANA (http://www.iana.org/
  assignments/media-types/)
• Allows reusable libraries and tools to
  handle various MIME types
Hypermedia Constraint
• Resources keep resource state, clients keep
  application state
• Resources provide URIs in their state to
  guide clients through the application state
• Clients need “know” only a single URI to
  enter an application, can get other needed
  URIs from resource representations
Separation of Concerns
•   RPC-oriented systems conflate methods and
    data
    •   Many ad hoc methods and data types, but
        just a single data format on the wire
•   REST separates methods and data formats

    •   Fixed set of methods, many standardized
        data formats, multiple formats possible per
        method
Enhancing Reuse
       Possibilities
• Separating concerns
 • libraries/tools for dealing with methods
 • separate libs/tools for dealing with data
• Uniformity
 • libraries for caching
 • libraries for interception and mediation
For Example
•   Consider a bug-tracking system

    •   HTML representations for interactive viewing,
        additions, modifications

    •   Excel or CSV representations for statistical tracking
        by importing into other tools

    •   XML (e.g. AtomPub) or JSON to allow use by other
        tools, for extensions and integration

    •   Atom feeds for watching bug activity

•   Existing clients that understand these formats can easily
    adapt to use them
Independence
• Each of the resources and formats on the
  previous page could be added
  independently without disturbing existing
  resource and formats
• You might add them “just because,” without
  an immediate need
 • plant the seeds to see what grows
Summary
•   RPC-oriented systems try to extend programming
    language paradigms over the wire

    •   encourages variation, which can’t scale

•   REST is purpose-built for distributed systems

    •   properly separates concerns and allows
        constrained variability only where required

    •   encourages combinations of orthogonal
        solutions into larger applications
Engineer for serendipity.
                  Roy T. Fielding
For More Information
•   Fielding’s thesis
    •   http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

•   Read various blogs: Mark Baker, Bill de hÓra, Joe Gregorio, Paul
    Downey, Benjamin Carlyle, Stu Charlton, Mark Nottingham

•   Sign up to the rest-discuss Yahoo mailing list

•   My “Toward Integration” columns in IEEE Internet Computing (all
    columns are available from http://steve.vinoski.net/), for example:

    •   Serendipitous Reuse (Jan/Feb 2008)

    •   Demystifying RESTful Data Coupling (Mar/Apr 2008)

Contenu connexe

En vedette

MangoTicks Jan08
MangoTicks Jan08MangoTicks Jan08
MangoTicks Jan08MangoTicks
 
Social Media & Freelancers Seminar
Social Media & Freelancers SeminarSocial Media & Freelancers Seminar
Social Media & Freelancers SeminarShashi Bellamkonda
 
Consture
ConstureConsture
Constureshrheng
 
The road to hell is paved with cut and paste
The road to hell is paved with cut and pasteThe road to hell is paved with cut and paste
The road to hell is paved with cut and pasteIan Lurie
 
Segmentation = Happiness: SEMPDX Presentation
Segmentation = Happiness: SEMPDX PresentationSegmentation = Happiness: SEMPDX Presentation
Segmentation = Happiness: SEMPDX PresentationIan Lurie
 
Keith Braithwaite Measure For Measure
Keith Braithwaite Measure For MeasureKeith Braithwaite Measure For Measure
Keith Braithwaite Measure For Measuredeimos
 
Ebooks: Landscape & Implications
Ebooks: Landscape & ImplicationsEbooks: Landscape & Implications
Ebooks: Landscape & ImplicationsBobbi Newman
 
Ideas and Evaluation of Digital Notetaking
Ideas and Evaluation of Digital NotetakingIdeas and Evaluation of Digital Notetaking
Ideas and Evaluation of Digital NotetakingAndrew McCarthy
 
May Ttf Lts 18 Th March 2009
May Ttf Lts 18 Th March 2009May Ttf Lts 18 Th March 2009
May Ttf Lts 18 Th March 2009Con Morris
 
Living Lab research landscape
Living Lab research landscapeLiving Lab research landscape
Living Lab research landscapeMarco Ferruzca
 
energy resources
energy resourcesenergy resources
energy resourcesbbrendaa
 
OCWC Slide Template
OCWC Slide TemplateOCWC Slide Template
OCWC Slide TemplateTerri Bays
 
Ivas Fondo Uag
Ivas Fondo UagIvas Fondo Uag
Ivas Fondo Uagpediatria
 

En vedette (20)

MangoTicks Jan08
MangoTicks Jan08MangoTicks Jan08
MangoTicks Jan08
 
Seminariotecnologia2010
Seminariotecnologia2010Seminariotecnologia2010
Seminariotecnologia2010
 
電腦作業
電腦作業電腦作業
電腦作業
 
Social Media & Freelancers Seminar
Social Media & Freelancers SeminarSocial Media & Freelancers Seminar
Social Media & Freelancers Seminar
 
Jalipo
JalipoJalipo
Jalipo
 
Consture
ConstureConsture
Consture
 
The road to hell is paved with cut and paste
The road to hell is paved with cut and pasteThe road to hell is paved with cut and paste
The road to hell is paved with cut and paste
 
Italia
ItaliaItalia
Italia
 
Segmentation = Happiness: SEMPDX Presentation
Segmentation = Happiness: SEMPDX PresentationSegmentation = Happiness: SEMPDX Presentation
Segmentation = Happiness: SEMPDX Presentation
 
Keith Braithwaite Measure For Measure
Keith Braithwaite Measure For MeasureKeith Braithwaite Measure For Measure
Keith Braithwaite Measure For Measure
 
Ebooks: Landscape & Implications
Ebooks: Landscape & ImplicationsEbooks: Landscape & Implications
Ebooks: Landscape & Implications
 
Lucy Copia
Lucy   CopiaLucy   Copia
Lucy Copia
 
Ideas and Evaluation of Digital Notetaking
Ideas and Evaluation of Digital NotetakingIdeas and Evaluation of Digital Notetaking
Ideas and Evaluation of Digital Notetaking
 
Sesion 1
Sesion 1Sesion 1
Sesion 1
 
Spain
SpainSpain
Spain
 
May Ttf Lts 18 Th March 2009
May Ttf Lts 18 Th March 2009May Ttf Lts 18 Th March 2009
May Ttf Lts 18 Th March 2009
 
Living Lab research landscape
Living Lab research landscapeLiving Lab research landscape
Living Lab research landscape
 
energy resources
energy resourcesenergy resources
energy resources
 
OCWC Slide Template
OCWC Slide TemplateOCWC Slide Template
OCWC Slide Template
 
Ivas Fondo Uag
Ivas Fondo UagIvas Fondo Uag
Ivas Fondo Uag
 

Similaire à REST, Reuse, and Serendipity</TITLE

Rest Reuse And Serendipity
Rest Reuse And SerendipityRest Reuse And Serendipity
Rest Reuse And SerendipityQConLondon2008
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawnozten
 
RESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems IntegrationRESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems IntegrationKirkWylie
 
Programming Language Selection
Programming Language SelectionProgramming Language Selection
Programming Language SelectionDhananjay Nene
 
Module: Mutable Content in IPFS
Module: Mutable Content in IPFSModule: Mutable Content in IPFS
Module: Mutable Content in IPFSIoannis Psaras
 
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketAPIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketScott Abel
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding ApacheconDaniel Parker
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introductionRandy Abernethy
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Marian Marinov
 
OSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of ChandlerOSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of ChandlerTed Leung
 
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Spark Summit
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesSteve Speicher
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systemsdairsie
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interactionOleksii Duhno
 
WSO2 Enterprise Integrator 101
WSO2 Enterprise Integrator 101WSO2 Enterprise Integrator 101
WSO2 Enterprise Integrator 101WSO2
 
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniDistributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniVMware Tanzu
 

Similaire à REST, Reuse, and Serendipity</TITLE (20)

Rest Reuse And Serendipity
Rest Reuse And SerendipityRest Reuse And Serendipity
Rest Reuse And Serendipity
 
Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289
 
Integrating RESTfully
Integrating RESTfullyIntegrating RESTfully
Integrating RESTfully
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawn
 
RESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems IntegrationRESTful Approaches to Financial Systems Integration
RESTful Approaches to Financial Systems Integration
 
Programming Language Selection
Programming Language SelectionProgramming Language Selection
Programming Language Selection
 
Module: Mutable Content in IPFS
Module: Mutable Content in IPFSModule: Mutable Content in IPFS
Module: Mutable Content in IPFS
 
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketAPIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
 
200211 Fielding Apachecon
200211 Fielding Apachecon200211 Fielding Apachecon
200211 Fielding Apachecon
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
OSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of ChandlerOSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of Chandler
 
Overview of ESB at Azilen Tech Meetup
Overview of ESB at Azilen Tech MeetupOverview of ESB at Azilen Tech Meetup
Overview of ESB at Azilen Tech Meetup
 
Qcon
QconQcon
Qcon
 
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interaction
 
WSO2 Enterprise Integrator 101
WSO2 Enterprise Integrator 101WSO2 Enterprise Integrator 101
WSO2 Enterprise Integrator 101
 
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniDistributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
 

Plus de deimos

Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Rubydeimos
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principlesdeimos
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuerydeimos
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwrdeimos
 
Aslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec BddAslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec Bdddeimos
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovydeimos
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languagesdeimos
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfacesdeimos
 
Tim Mackinnon Agile And Beyond
Tim Mackinnon Agile And BeyondTim Mackinnon Agile And Beyond
Tim Mackinnon Agile And Beyonddeimos
 
Stefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The WebStefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The Webdeimos
 
Stefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To RestStefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To Restdeimos
 
Rod Johnson Cathedral
Rod Johnson CathedralRod Johnson Cathedral
Rod Johnson Cathedraldeimos
 
Mike Stolz Dramatic Scalability
Mike Stolz Dramatic ScalabilityMike Stolz Dramatic Scalability
Mike Stolz Dramatic Scalabilitydeimos
 
Matt Youill Betfair
Matt Youill BetfairMatt Youill Betfair
Matt Youill Betfairdeimos
 
Pete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two SystemsPete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two Systemsdeimos
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registrydeimos
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 
Neal Gafter Java Evolution
Neal Gafter Java EvolutionNeal Gafter Java Evolution
Neal Gafter Java Evolutiondeimos
 
Markus Voelter Textual DSLs
Markus Voelter Textual DSLsMarkus Voelter Textual DSLs
Markus Voelter Textual DSLsdeimos
 

Plus de deimos (20)

Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principles
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuery
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwr
 
Aslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec BddAslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec Bdd
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovy
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languages
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
 
Tim Mackinnon Agile And Beyond
Tim Mackinnon Agile And BeyondTim Mackinnon Agile And Beyond
Tim Mackinnon Agile And Beyond
 
Stefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The WebStefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The Web
 
Stefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To RestStefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To Rest
 
Rod Johnson Cathedral
Rod Johnson CathedralRod Johnson Cathedral
Rod Johnson Cathedral
 
Mike Stolz Dramatic Scalability
Mike Stolz Dramatic ScalabilityMike Stolz Dramatic Scalability
Mike Stolz Dramatic Scalability
 
Matt Youill Betfair
Matt Youill BetfairMatt Youill Betfair
Matt Youill Betfair
 
Pete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two SystemsPete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two Systems
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registry
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Neal Gafter Java Evolution
Neal Gafter Java EvolutionNeal Gafter Java Evolution
Neal Gafter Java Evolution
 
Markus Voelter Textual DSLs
Markus Voelter Textual DSLsMarkus Voelter Textual DSLs
Markus Voelter Textual DSLs
 

Dernier

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

REST, Reuse, and Serendipity</TITLE

  • 1. REST, Reuse, and Serendipity Steve Vinoski Member of Technical Staff Verivue Westford, MA USA QCon London 2008
  • 2. serendipity (noun): the occurrence and development of events by chance in a happy or beneficial way.
  • 3. Motivation • Many folks in the web world already understand the capabilities and power of REST • if this describes you, this talk may bore you • But to many involved in enterprise integration and middleware, REST is entirely new and misunderstood • this talk is for you
  • 5. Some Solutions • Descendants of Remote Procedure Call (RPC) • CORBA, EJB, .NET, SCA • SOAP, WSDL, WS-* • Enterprise messaging • Messaging queuing • Enterprise Application Integration (EAI)
  • 6. Problems with MQ • Generally proprietary, except for: • JMS: open messaging interfaces • AMQP: open messaging protocol (and open source Apache implementation) • Can be expensive
  • 7. Problems with EAI • EAI systems are typically: • proprietary and expensive • centralized hubs • costly to customize and maintain • Some ESBs have fallen into this category • old EAI products re-labeled
  • 8. Problems with RPC Approaches • Focus on language first • tries to fit the distributed system to the language, not vice-versa • Tries to make distributed calls appear local • ignores partial failure and latency issues • Exposes language-specific objects directly as language-independent services
  • 9. More RPC Problems • Code generation • traditionally, stub code generated from a definition language, e.g. IDL or WSDL • today WSDL is often reverse-generated from annotated language definitions • Both approaches can create deceptively significant consumer-service coupling
  • 10. Type System Illusions • RPC-oriented systems offer the illusion of type safety • define interface types • define data types to pass via methods • But there is no type safety across the wire • This type specialization is costly for scalability and reuse
  • 11. Interfaces are Protocols • In RPC-oriented systems, a new service interface is a new application protocol • consumers hard-code knowledge of method names and semantics • consumers must inherently know which method to call, possibly in what order • no semantic constraints on methods
  • 12. Data Specialization • RPC-oriented systems encourage specialized data definitions • same as defining regular classes/methods • Using XML is better than using IDL types or programming language types • but benefits disappear if you generate code from it
  • 13. Integration Problem Summary • Proprietary approaches too expensive • Standard approaches focus on implementation languages, not distributed systems issues • New interface == new application protocol • Ad hoc data formats coupled to interfaces • All these problems inhibit reuse
  • 14. A Detour: UNIX Reuse • Consider the UNIX shell pipe • chain output of one tool to input of another • old tools and new can interact, even though independently developed • easily combine existing tools into new ones
  • 15. UNIX Pipes • The pipe is based on two key features • the uniform interface of the “file-like object” • the standard file descriptor framework for applications: stdin, stdout, stderr • Standard ways to get data to/from applications • The pipe results from modularity and simplicity (and serendipity, perhaps?)
  • 16. REST’s Uniform Interface Constraint • Generalized resource interface • in HTTP, methods are the protocol verbs Method Purpose Idempotent? GET Retrieve resource state Yes representation (no side effects) Provide resource state PUT representation Yes Create or extend a POST resource No DELETE Delete a resource Yes
  • 17. Uniform Interface Benefits • Enables visibility into interactions • including caching, monitoring, mediation applicable across all resources • Provides strong implementation hiding, independent evolvability • Simplified overall architecture
  • 18. Generic Invocation • The uniform interface makes reusable generic invocation libraries possible • python urllib, urllib2, httplib, httplib2 • curl command-line tool • many others, in many languages • Server-side dispatching simplified as well • No need for generated code
  • 19. Four Sub-Constraints • Resource identification via URIs • Resource manipulation through the exchange of resource state representations • Self-describing messages with potentially multiple representation formats • Hypermedia as the engine of application state (HATEOAS, or hypermedia constraint)
  • 20. Representations • Method payloads are representations of resource state • Methods often support multiple representation formats • Representation format is not method- specific as with RPC-oriented approaches
  • 21. Media Types • Representation formats identified using media (MIME) types • These types are standardized/registered through the IANA (http://www.iana.org/ assignments/media-types/) • Allows reusable libraries and tools to handle various MIME types
  • 22. Hypermedia Constraint • Resources keep resource state, clients keep application state • Resources provide URIs in their state to guide clients through the application state • Clients need “know” only a single URI to enter an application, can get other needed URIs from resource representations
  • 23. Separation of Concerns • RPC-oriented systems conflate methods and data • Many ad hoc methods and data types, but just a single data format on the wire • REST separates methods and data formats • Fixed set of methods, many standardized data formats, multiple formats possible per method
  • 24. Enhancing Reuse Possibilities • Separating concerns • libraries/tools for dealing with methods • separate libs/tools for dealing with data • Uniformity • libraries for caching • libraries for interception and mediation
  • 25. For Example • Consider a bug-tracking system • HTML representations for interactive viewing, additions, modifications • Excel or CSV representations for statistical tracking by importing into other tools • XML (e.g. AtomPub) or JSON to allow use by other tools, for extensions and integration • Atom feeds for watching bug activity • Existing clients that understand these formats can easily adapt to use them
  • 26. Independence • Each of the resources and formats on the previous page could be added independently without disturbing existing resource and formats • You might add them “just because,” without an immediate need • plant the seeds to see what grows
  • 27. Summary • RPC-oriented systems try to extend programming language paradigms over the wire • encourages variation, which can’t scale • REST is purpose-built for distributed systems • properly separates concerns and allows constrained variability only where required • encourages combinations of orthogonal solutions into larger applications
  • 28. Engineer for serendipity. Roy T. Fielding
  • 29. For More Information • Fielding’s thesis • http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm • Read various blogs: Mark Baker, Bill de hÓra, Joe Gregorio, Paul Downey, Benjamin Carlyle, Stu Charlton, Mark Nottingham • Sign up to the rest-discuss Yahoo mailing list • My “Toward Integration” columns in IEEE Internet Computing (all columns are available from http://steve.vinoski.net/), for example: • Serendipitous Reuse (Jan/Feb 2008) • Demystifying RESTful Data Coupling (Mar/Apr 2008)