bicocca restws pautasso talk

17
1 19.6.2008 University of Milano Bicocca, Italy ©2008 Cesare Pautasso 3 Web Services in 2008: to REST or not to REST? Cesare Pautasso Faculty of Informatics University of Lugano, CH http://www.pautasso.info 19.6.2008 University of Milano Bicocca, Italy ©2008 Cesare Pautasso 4 Web Sites (1992) HTTP HTML Web Browser Web Server (HTTP) SOAP Server Client XML WSDL WS-* Web Services (2000)

Upload: kvkpasumarthi

Post on 01-Jul-2015

559 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Bicocca Restws Pautasso Talk

1

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

3

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

Cesare PautassoFaculty of Informatics

University of Lugano, CHhttp://www.pautasso.info

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

4

Web Sites (1992)

HTTP

HTMLWeb Browser

Web Server

(HTTP)

SOAP

ServerClient XMLWSDL

WS-* Web Services (2000)

Page 2: Bicocca Restws Pautasso Talk

2

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

5

RESTful Web Services (2007)

Client HTTP

PO-XM

L

RSS

JSON

Web Server

WADL

WS-* Web Services (2000)

(HTTP)

SOAP

ServerClient XMLWSDL

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

6

Page 3: Bicocca Restws Pautasso Talk

3

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

7

XML

URI HTTP

MIME

JSON

RESTful

SSL

RSS

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

8

Is REST being used?

Slide from

Paul Dow

ney, BT

Page 4: Bicocca Restws Pautasso Talk

4

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

9

Can we really compare WS-* vs. REST?

WS-* REST

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

10

Can we really compare WS-* vs. REST?

WS-*

MiddlewareInteroperability

Standards

REST

Architecturalstyle for the Web

Page 5: Bicocca Restws Pautasso Talk

5

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

11

How to compare?

WS-*

MiddlewareInteroperability

Standards

REST

Architecturalstyle for the Web

Architectural

Decision Modeling

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

12

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 forintegration projects

• Architectural decisions affect one another

Architectural Decision:Communication Protocol

Architecture Alternatives:1. TCP2. SMTP3. HTTP4. MQ5. BEEP6. CORBA IIOP7. …

Rationale

Page 6: Bicocca Restws Pautasso Talk

6

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

13

Application Integration Styles

File Transfer

Shared Database

Message BusRemoteProcedure

Call

WS-*REST

Integration Technology Platform

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

14

Related Decisions (WS-*)

File Transfer

Shared Database

Message BusRemoteProcedure

Call

WS-*REST

Page 7: Bicocca Restws Pautasso Talk

7

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

15

Related Decisions (RPC)

File Transfer

Shared Database

Message BusRemoteProcedure

Call

WS-*REST

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

16

Decision Space Overview

Page 8: Bicocca Restws Pautasso Talk

8

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

17

Outline

21 Decisions and 64 alternativesClassified 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-*

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

18

Architectural Principles

1. Protocol Layering• HTTP = Application-level Protocol (REST)• HTTP = Transport-level Protocol (WS-*)

2. Dealing with Heterogeneity3. Loose Coupling

Page 9: Bicocca Restws Pautasso Talk

9

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

19

RESTful Web Service Example

HTTP Client

(Web Browser)

Web Server Database

GET /book?ISBN=222SELECT *

FROM books WHERE isbn=222

POST /order INSERT INTO orders301 Location: /order/612

PUT /order/612 UPDATE ordersWHERE id=612

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

20

Big Web Service Example (from REST perspective)

HTTP Client

(Stub Object)

Web Server

POST /soap/endpoint

POST /soap/endpoint

POST /soap/endpoint

return getBook(222)

return new Order()

order.setCustomer(x)

Web Service

Implementation

Page 10: Bicocca Restws Pautasso Talk

10

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

21

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”

Application

Resource URI

HTTPPOST

Application

Endpoint URI

POX

HTTPGET

HTTPPUT

HTTPDEL

HTTPPOST

SOAP (WS-*)

MQ…SMTP

RSS JSON …

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

22

Dealing with Heterogeneity

CICSIMS

Picture from

Eric N

ewcom

er, ION

A

• Enterprise Computing

HTTP

• Web Applications

Page 11: Bicocca Restws Pautasso Talk

11

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

23

Conceptual Comparison

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

24

Technology Comparison

Page 12: Bicocca Restws Pautasso Talk

12

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

25

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

3527Alternatives1417Decisions

WS-*REST

Decisions with 1 or more alternative options

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

26

Measuring Complexity

3527Alternatives1417Decisions

WS-*REST

Decisions with 1 or more alternative options

3216Alternatives125Decisions

WS-*REST

Decisions with more than 1 alternative options

Page 13: Bicocca Restws Pautasso Talk

13

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

27

Measuring Complexity

3216Alternatives125Decisions

WS-*REST

Decisions with more than 1 alternative options

• URI Design• Resource Interaction Semantics• Payload Format• Service Description• Service Composition

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

28

Measuring Complexity

3216Alternatives125Decisions

WS-*REST

Decisions with more than 1 alternative options

212DecisionsWS-*REST

Decisions with only 1 alternative option

Page 14: Bicocca Restws Pautasso Talk

14

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

29

Measuring Complexity

212DecisionsWS-*REST

Decisions with only 1 alternative option

• Payload Format• Data Representation Modeling

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

30

Measuring Effort

212DecisionsWS-*REST

Decisions with only 1 alternative option

05Do-it-yourself Alternatives

WS-*REST

Decisions with only do-it-yourself alternatives

Page 15: Bicocca Restws Pautasso Talk

15

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

31

Measuring Effort

05Do-it-yourself Alternatives

WS-*REST

Decisions with only do-it-yourself alternatives

• Resource Identification• Resource Relationship• Reliability• Transactions• Service Discovery

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

32

Freedom of ChoiceFreedom from Choice

Page 16: Bicocca Restws Pautasso Talk

16

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

33

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)

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

34

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.

Page 17: Bicocca Restws Pautasso Talk

17

19.6.2008 University of Milano Bicocca, Italy©2008 Cesare Pautasso

35

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.