Transcription of REST vs. SOAP: Making the Right Architectural …
1 Symposium 2008, Amsterdam 2008 Cesare Pautasso1 REST vs. SOAP: Making the Right Architectural DecisionCesare PautassoFaculty of InformaticsUniversity of Lugano (USI), Symposium 2008, Amsterdam 2008 Cesare Pautasso2 Agenda1. Motivation: A short history of Web Services2. Comparing REST vs. SOAP/WS-*3. Architectural decision Modeling4. Conceptual Comparison5. Technology Comparison6. How to measure the complexity of WS-* or the simplicity of REST?7. Conclusion: Making the Right Architectural Symposium 2008, Amsterdam 2008 Cesare Pautasso3 Web Sites (1992)HTTPHTMLWeb BrowserWeb Server(HTTP)SOAPS erverClientXMLWSDLWS-*Web Services (2000) Symposium 2008, Amsterdam 2008 Cesare Pautasso4 RESTfulWeb Services (2006)ClientHTTPPO-XMLRSSJSONWeb ServerWADLWS-*Web Services (2000)(HTTP) Symposium 2008, Amsterdam 2008 Cesare Symposium 2008, Amsterdam 2008 Cesare Symposium 2008, Amsterdam 2008 Cesare Pautasso7Is REST being used?
2 Slide from Paul Downey, BT Symposium 2008, Amsterdam 2008 Cesare Pautasso8 Can we really compare WS-* vs. REST?WS-* Symposium 2008, Amsterdam 2008 Cesare Pautasso9 Can we really compare WS-* vs. REST?WS-*SOA MiddlewareInteroperabilityStandardsRESTA rchitecturalstyle for the Symposium 2008, Amsterdam 2008 Cesare Pautasso10 How to compare?WS-*SOA MiddlewareInteroperabilityStandardsRESTA rchitecturalstyle for the WebArchitecturalDecision Symposium 2008, Amsterdam 2008 Cesare Pautasso11 Architectural Decisions Architectural decisions capture the main design issues and the rationale behind a chosen technical solution The choice between REST vs.
3 WS-* is an important Architectural decision forintegration projects Architectural decisions affect one anotherArchitectural decision :Communication ProtocolArchitecture Alternatives:1. TCP2. SMTP3. HTTP4. MQ5. BEEP6. CORBA IIOP7.. Symposium 2008, Amsterdam 2008 Cesare Pautasso12 Application Integration StylesFile TransferShared DatabaseMessage BusRemoteProcedure CallWS-*RESTI ntegration Technology Symposium 2008, Amsterdam 2008 Cesare Pautasso13 Related Decisions (WS-*)File TransferShared DatabaseMessage BusRemoteProcedure CallWS-* Symposium 2008, Amsterdam 2008 Cesare Pautasso14 Related Decisions (RPC)
4 File TransferShared DatabaseMessage BusRemoteProcedure CallWS-* Symposium 2008, Amsterdam 2008 Cesare Pautasso15 decision Space Symposium 2008, Amsterdam 2008 Cesare Pautasso16 decision Space Summary21 Decisions and 64 alternativesClassified by level of abstraction: 3 Architectural Principles 9 ConceptualDecisions 9 Technology-level DecisionsDecisions help us to measure the complexityimplied by the choice of REST or WS-* Symposium 2008, Amsterdam 2008 Cesare Pautasso17 Architectural Principles1. Protocol Layering HTTP = Application-level Protocol (REST) HTTP = Transport-level Protocol(WS-*)2. Dealing with Heterogeneity3.
5 Loose Symposium 2008, Amsterdam 2008 Cesare Pautasso18 RESTful Web Service ExampleHTTP Client(Web Browser)Web ServerDatabaseGET /book?ISBN=222 SELECT * FROM books WHERE isbn=222 POST /orderINSERT INTO orders301 Location: /order/612 PUT /order/612 UPDATE ordersWHERE id= Symposium 2008, Amsterdam 2008 Cesare Pautasso19 Big Web Service Example (from REST perspective)HTTP Client(Stub Object)Web ServerPOST /soap/endpointPOST /soap/endpointPOST /soap/endpointreturn getBook(222)return new Order() (x)Web Symposium 2008, Amsterdam 2008 Cesare Pautasso20 Protocol Layering The Web is the universe of globally accessible information (Tim Berners Lee) Applications should publish their data on the Web (through URI) The Web is the universal (tunneling)
6 Transport for messages Applications get a chance to interact but they remain outside of the Web ApplicationResourceURIHTTPPOSTA pplicationEndpointURIPOXHTTPGETHTTPPUTHT TPDELHTTPPOSTSOAP (WS-*) Symposium 2008, Amsterdam 2008 Cesare Pautasso21 Dealing with HeterogeneityCICSIMSP icture from Eric Newcomer, IONA Enterprise ComputingHTTP Web Symposium 2008, Amsterdam 2008 Cesare Pautasso22 Conceptual ComparisonNote: this table will scroll up during the Symposium 2008, Amsterdam 2008 Cesare Pautasso23 Technology ComparisonNote: this table will scroll up during the Symposium 2008, Amsterdam 2008 Cesare Pautasso24 Measuring Complexity Architectural Decisions give a quantitative measureof the complexity of an Architectural design space.
7 Total number of decisions For each decision , number of alternative options For each alternative option, estimate the effort3527 Alternatives1417 DecisionsWS-*RESTD ecisions with1 or more alternative Symposium 2008, Amsterdam 2008 Cesare Pautasso25 Measuring Complexity3527 Alternatives1417 DecisionsWS-*RESTD ecisions with1 or more alternative options3216 Alternatives125 DecisionsWS-*RESTD ecisions withmore than 1 alternative Symposium 2008, Amsterdam 2008 Cesare Pautasso26 Measuring Complexity3216 Alternatives125 DecisionsWS-*RESTD ecisions withmore than 1 alternative options URI Design Resource Interaction Semantics Payload Format Service Description Service Symposium 2008, Amsterdam 2008 Cesare Pautasso27 Measuring Complexity3216 Alternatives125 DecisionsWS-*RESTD ecisions withmore than 1 alternative options212 DecisionsWS-*RESTD ecisions withonly 1 alternative Symposium 2008.
8 Amsterdam 2008 Cesare Pautasso28 Measuring Complexity212 DecisionsWS-*RESTD ecisions withonly 1 alternative option Payload Format Data Representation Symposium 2008, Amsterdam 2008 Cesare Pautasso29 Measuring Effort212 DecisionsWS-*RESTD ecisions withonly 1 alternative option05Do-it-yourself AlternativesWS-*RESTD ecisions with onlydo-it-yourself Symposium 2008, Amsterdam 2008 Cesare Pautasso30 Measuring Effort05Do-it-yourself AlternativesWS-*RESTD ecisions with onlydo-it-yourself alternatives Resource Identification Resource Relationship Reliability Transactions Service Symposium 2008, Amsterdam 2008 Cesare Pautasso31 Freedom of ChoiceFreedom from Symposium 2008, Amsterdam 2008 Cesare Pautasso32 Comparison Summary Architectural Decisions measure complexity implied by alternative technologies REST simplicity= freedom from choice 5 decisions require to choose among 16 alternatives 12 decisions are already taken (but 5 aredo-it-yourself)
9 WS-* complexity= freedom of choice 12 decisions require to choose among 32 alternatives 2 decisions are already taken (SOAP, WSDL+XSD) Symposium 2008, Amsterdam 2008 Cesare Pautasso33 Conclusion You should focus on whatever solution gets the job done and try to avoid being religiousabout any specific architectures or technologies. WS-* has strengths and weaknesses and will be highly suitable to some applications and positively terrible for others. Likewise with REST. The decision of which to use depends entirely on the application requirements and constraints. We hope this comparison will help you make the Right Symposium 2008, Amsterdam 2008 Cesare Pautasso34 References Cesare Pautasso, Olaf Zimmermann, Frank Leymann, RESTful Web Services vs.
10 Big Web Services: Making the Right Architectural decision , Proc. of the 17th International World Wide Web Conference (WWW2008), Bejing, China, April 2008. Cesare Pautasso, BPEL for REST, Proc. of the 6th International Conference on Business Process Management (BPM 2008), Milan, Italy, September 2008. Cesare Pautasso, Gustavo Alonso: From Web Service Composition to MegaprogrammingIn: Proceedings of the 5th VLDB Workshop on Technologies for E-Services (TES-04), Toronto, Canada, August 29-30, Symposium 2008, Amsterdam 2008 Cesare Pautasso35 REST vs. SOAP: Making the Right Architectural DecisionCesare PautassoFaculty of InformaticsUniversity of Lugano (USI), Symposium 2008, Amsterdam 2008 Cesare Pautasso36 Backup Materialon RESTC esare PautassoFaculty of InformaticsUniversity of Lugano (USI), Symposium 2008, Amsterdam 2008 Cesare Pautasso37 REST in one Slide REpresentational State Transfer defines the Architectural style of the World Wide Web Its four principles can explain the success and the scalability of the HTTP protocol implementing them1.