REST vs. SOAP: Making the Right Architectural Decision



Similar documents
Web Services in 2008: to REST or not to REST?

vs WS-* Comparison Cesare Pautasso Faculty of Informatics University of Lugano, Switzerland

Some REST Design Patterns (and Anti-Patterns)

BPMN for REST. Cesare Pautasso Faculty of Informatics, USI Lugano, Switzerland

Techniques for Composing REST services

REST web services. Representational State Transfer Author: Nemanja Kojic

Push-Enabling RESTful Business Processes

Session 6 Patterns and best practices in SOA/REST

Service Computing: Basics Monica Scannapieco

Getting Started with Service- Oriented Architecture (SOA) Terminology

02267: Software Development of Web Services

Lesson 4 Web Service Interface Definition (Part I)

REST Web Services in Collaborative Work Environments

Principles and Foundations of Web Services: An Holistic View (Technologies, Business Drivers, Models, Architectures and Standards)

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

EAI OVERVIEW OF ENTERPRISE APPLICATION INTEGRATION CONCEPTS AND ARCHITECTURES. Enterprise Application Integration. Peter R. Egli INDIGOO.

This project was supported by Grant No DB-BX-K105 awarded by the Bureau of Justice, Office of Justice Programs in collaboration with the U.S.

Introduction to Service Oriented Architectures (SOA)

Service-Oriented Architecture and Software Engineering

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

RESTful Web Services vs. Big Web Services: Making the Right Architectural Decision

Enabling REST Services with SAP PI. Michael Le Peter Ha

Closer Look at Enterprise Service Bus. Deb L. Ayers Sr. Principle Product Manager Oracle Service Bus SOA Fusion Middleware Division

How To Understand A Services-Oriented Architecture

SOA and Virtualization Technologies (ENCS 691K Chapter 2)

Controlling and Monitoring Devices with REST

So You Want an SOA: Best Practices for Migrating to SOA in the Enterprise. Eric Newcomer, CTO

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Service Oriented Architecture

XML Processing and Web Services. Chapter 17

02267: Software Development of Web Services

IJISET - International Journal of Innovative Science, Engineering & Technology, Vol. 1 Issue 7, September

Designing RESTful Web Applications

Distribution and Integration Technologies

Service Oriented Architectures

Mobility Information Series

Service-Oriented Architectures

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Architectural Decisions as Service Realization Methodology in Model-Driven SOA Construction

Advancing Integration Competency and Excellence with the WSO2 Integration Platform

1 What Are Web Services?

SOA Planning Guide The Value Enablement Group, LLC. All rights reserved.

Creating Web Services in NetBeans

Integrating Complementary Tools with PopMedNet TM

REST-based Offline System

Service-Oriented Architecture: Analysis, the Keys to Success!

Building Web-based Infrastructures for Smart Meters

Ole Lensmar CTO SmartBear Software PAST, PRESENT AND FUTURE OF APIS FOR MOBILE AND WEB APPS

Introduction to Service-Oriented Architecture for Business Analysts

The Central Role of Registries

Mobile devices as Web service providers

Literature Review Service Frameworks and Architectural Design Patterns in Web Development

Challenges and Opportunities for formal specifications in Service Oriented Architectures

Setting the World on FHIR

1 What Are Web Services?

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

e-gov Architecture Service Interface Guidelines

Alternatives to SNMP and Challenges in Management Protocols. Communication Systems Seminar Talk 10 Francesco Luminati

Web Services Technologies

Service-oriented architecture in e-commerce applications

A standards-based approach to application integration

Introduction into Web Services (WS)

CST6445: Web Services Development with Java and XML Lesson 1 Introduction To Web Services Skilltop Technology Limited. All rights reserved.

Core Feature Comparison between. XML / SOA Gateways. and. Web Application Firewalls. Jason Macy jmacy@forumsys.com CTO, Forum Systems

Security Testing For RESTful Applications

SIP Protocol as a Communication Bus to Control Embedded Devices

Network Security. Chapter 10. Application Layer Security: Web Services. Part I: Introduction to Web Services

Federated Service Oriented Architecture for Effects-Based Operations

AquaLogic ESB Design and Integration (3 Days)

September 2009 Cloud Storage for Cloud Computing

The Enterprise Service Bus

XIII. Service Oriented Computing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

Agents and Web Services

Chapter. Solve Performance Problems with FastSOA Patterns. The previous chapters described the FastSOA patterns at an architectural

Methods and tools for data and software integration Enterprise Service Bus

Architectural Requirements for an SOA Based on Web Services. Jim Bole VP, Engineering Infravio, Inc. April 23, 2003

Oracle Service Bus Examples and Tutorials

Classic Grid Architecture

AquaLogic Service Bus

Lightweight Data Integration using the WebComposition Data Grid Service

Simplifying Processes Interoperability with a Service Oriented Architecture

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

SOA CERTIFIED JAVA DEVELOPER (7 Days)

Apache CXF Web Services

Developers Integration Lab (DIL) System Architecture, Version 1.0

Implementing Mobile Thin client Architecture For Enterprise Application

SCA-based Enterprise Service Bus WebSphere ESB

Architectures, and. Service-Oriented. Cloud Computing. Web Services, The Savvy Manager's Guide. Second Edition. Douglas K. Barry. with.

A Semantic Approach for Access Control in Web Services

From RPC to Web Apps: Trends in Client-Server Systems

Microsoft SQL Data Services Under the Hood

Reusing Existing * Java EE Applications from Oracle SOA Suite

Oracle SOA Reference Architecture

Scaling Web Services. W3C Workshop on Web Services. Mark Nottingham. Web Service Scalability and Performance with Optimizing Intermediaries

SOA CERTIFIED CONSULTANT

Building the European Biodiversity. Observation Network (EU BON)

Enhanced Mobile Cloud Computing Platform

Web application development landscape: technologies and models

Transcription:

REST vs. SOAP: Making the Right Architectural Decision Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info 1

Agenda 1. Motivation: A short history of Web Services 2. Comparing REST vs. SOAP/WS-* 3. Architectural Decision Modeling 4. Conceptual Comparison 5. Technology Comparison 6. How to measure the complexity of WS-* or the simplicity of REST? 7. Conclusion: Making the right Architectural Decision 2

Web Sites (1992) Web Browser HTML HTTP Web Server WS-* Web Services (2000) Client SOAP XML (HTTP) WSDL Server 3

RESTful Web Services (2006) Client RSS PO-XML JSON HTTP WADL Web Server WS-* Web Services (2000) Client SOAP XML (HTTP) WSDL Server 4

5

RESTful RSS XML JSON MIME URI HTTP SSL 6

Is REST being used? Slide from Paul Downey, BT 7

Can we really compare WS-* vs. REST? WS-* REST 8

Can we really compare WS-* vs. REST? WS-* SOA Middleware Interoperability Standards REST Architectural style for the Web 9

How to compare? WS-* SOA Middleware Interoperability Standards Architectural Decision Modeling REST Architectural style for the Web 10

Architectural Decisions Architectural decisions capture the main design issues and the rationale behind a chosen technical solution The choice between REST vs. WS-* is an important architectural decision for integration projects Architectural decisions affect one another Architectural Decision: Communication Protocol Architecture Alternatives: 1. TCP 2. SMTP 3. HTTP 4. MQ 5. BEEP 6. CORBA IIOP 7. Rationale 11

Application Integration Styles Shared Database Remote Procedure Call Message Bus File Transfer REST WS-* Integration Technology Platform 12

Related Decisions (WS-*) Shared Database Remote Procedure Call Message Bus File Transfer REST WS-* 13

Related Decisions (RPC) Shared Database Remote Procedure Call Message Bus File Transfer REST WS-* 14

Decision Space Overview 15

Decision Space Summary 21 Decisions and 64 alternatives Classified by level of abstraction: 3 Architectural Principles 9 Conceptual Decisions 9 Technology-level Decisions Decisions help us to measure the complexity implied by the choice of REST or WS-* 16

Architectural Principles 1. Protocol Layering HTTP = Application-level Protocol (REST) HTTP = Transport-level Protocol (WS-*) 2. Dealing with Heterogeneity 3. Loose Coupling 17

RESTful Web Service Example HTTP Client (Web Browser) Web Server Database GET /book?isbn=222 POST /order 301 Location: /order/612 PUT /order/612 SELECT * FROM books WHERE isbn=222 INSERT INTO orders UPDATE orders WHERE id=612 18

HTTP Client (Stub Object) Big Web Service Example (from REST perspective) Web Server Web Service Implementation POST /soap/endpoint POST /soap/endpoint POST /soap/endpoint return getbook(222) return new Order() order.setcustomer(x) 19

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) transport for messages Applications get a chance to interact but they remain outside of the Web POX RSS JSON SOAP (WS-*) HTTP GET HTTP POST HTTP PUT HTTP DEL SMTP HTTP POST MQ Resource URI Application Endpoint URI Application 20

Dealing with Heterogeneity Web Applications Enterprise Computing HTTP CICS IMS Picture from Eric Newcomer, IONA 21

Conceptual Comparison Note: this table will scroll up during the talk 22

Technology Comparison Note: this table will scroll up during the talk 23

Measuring Complexity Architectural Decisions give a quantitative measure of the complexity of an architectural design space: Total number of decisions For each decision, number of alternative options For each alternative option, estimate the effort Decisions Alternatives REST 17 27 WS-* 14 35 Decisions with 1 or more alternative options 24

Measuring Complexity Decisions Alternatives REST 5 16 WS-* 12 32 Decisions with more than 1 alternative options Decisions Alternatives REST 17 27 WS-* 14 35 Decisions with 1 or more alternative options 25

Measuring Complexity Decisions Alternatives REST 5 16 WS-* 12 32 Decisions with more than 1 alternative options URI Design Resource Interaction Semantics Payload Format Service Description Service Composition 26

Measuring Complexity Decisions Alternatives REST 5 16 WS-* 12 32 Decisions with more than 1 alternative options Decisions REST 12 WS-* 2 Decisions with only 1 alternative option 27

Measuring Complexity Payload Format Data Representation Modeling Decisions REST 12 WS-* 2 Decisions with only 1 alternative option 28

Measuring Effort Do-it-yourself Alternatives REST 5 WS-* 0 Decisions with only do-it-yourself alternatives Decisions REST 12 WS-* 2 Decisions with only 1 alternative option 29

Measuring Effort Do-it-yourself Alternatives REST 5 WS-* 0 Decisions with only do-it-yourself alternatives Resource Identification Resource Relationship Reliability Transactions Service Discovery 30

Freedom of Choice Freedom from Choice 31

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 are do-it-yourself) WS-* complexity = freedom of choice 12 decisions require to choose among 32 alternatives 2 decisions are already taken (SOAP, WSDL+XSD) 32

Conclusion You should focus on whatever solution gets the job done and try to avoid being religious about 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 choice. 33

References Cesare Pautasso, Olaf Zimmermann, Frank Leymann, RESTful Web Services vs. 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 Megaprogramming In: Proceedings of the 5th VLDB Workshop on Technologies for E-Services (TES-04), Toronto, Canada, August 29-30, 2004. 34

REST vs. SOAP: Making the Right Architectural Decision Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info 35

Backup Material on REST Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info 36

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 them 1. Resource Identification through URI 2. Uniform Interface for all resources: GET (Query the state, idempotent, can be cached) POST (Update a resource or create child resource) PUT (Transfer the state on existing/new resource) DELETE (Delete a resource) 3. Self-Descriptive Message representations 4. Hyperlinks to define relationships between resources and valid state transitions of the service interaction 37

URI: Uniform Resource Identifier Internet Standard for resource naming and identification (originally from 1994, revised until 2005) Examples: http://tools.ietf.org/html/rfc3986 URI Scheme Authority Path https://www.google.ch/search?q=rest&start=10#1 Query Fragment REST advocates the use of nice URIs In most HTTP stacks URIs cannot have arbitrary length (4Kb) 38

What is a nice URI? http://map.search.ch/lugano Prefer Nouns to Verbs Keep them Short http://maps.google.com/lugano http://maps.google.com/maps?f=q&hl=en&q=lugano, +switzerland&layer=&ie=utf8&z=12&om=1&iwloc=addr 39

Uniform Interface Principle (CRUD Example) CRUD CREATE READ UPDATE DELETE REST POST/PUT GET PUT DELETE Initialize the state of a new resource at the given URI Retrieve the current state of the resource Modify the state of a resource Clear a resource, after the URI is no longer valid 40

POST vs. GET GET is a read-only operation. It can be repeated without affecting the state of the resource (idem-potent) POST is a read-write operation and may change the state of the resource and provoke side effects on the server. Web browsers warn you when refreshing a page generated with POST 41

RESTful Web Services Design 1. Identify resources to be exposed as services (e.g., yearly risk report, book catalog, purchase order, open bugs) 2. Define nice URLs to address them GET PUT POST DELETE 3. Understand what it means to do a GET, POST, PUT, DELETE on a given resource URI /loan /balance X X X 4. Design and document resource representations (payload formats) 5. Model relationships (e.g., containment, reference, state transitions) between resources with hyperlinks that can be followed to get more details /client /book /order??? 6. Implement and deploy on Web server 7. Test with a Web browser /soap X X X 42

Resource Representation Formats: XML vs JSON XML PO-XML SOAP(WS-*) RSS, ATOM Standard textual syntax for semi-structured data Many tools available: XML Schema, DOM, SAX, XPath, XSLT, XQuery Everyone can parse it (not necessarily understand it) Slow and Verbose JavaScript Object Notation (JSON) Wire format introduced for AJAX Web applications (Browser- Web Server communication) Textual syntax for serialization of non-recurrent data structures Supported in most languages (not only JavaScript) Not extensible (does not need to be) JSON has become the X in Ajax 43