More Related Content
Similar to Bicocca Restws Pautasso Talk
Similar to Bicocca Restws Pautasso Talk (20)
Bicocca Restws Pautasso Talk
- 1. 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 3
©2008 Cesare Pautasso
Web Sites (1992)
Web HTML Web
Browser HTTP Server
WS-* Web Services (2000)
SOAP WSDL
Client XML Server
19.6.2008
(HTTP)
University of Milano Bicocca, Italy 4
©2008 Cesare Pautasso
1
- 2. RESTful Web Services (2007)
PO-XML
JSON
RSS
WADL
Web
Client
HTTP Server
WS-* Web Services (2000)
SOAP WSDL
Client XML Server
19.6.2008
(HTTP)
University of Milano Bicocca, Italy 5
©2008 Cesare Pautasso
19.6.2008 University of Milano Bicocca, Italy 6
©2008 Cesare Pautasso
2
- 3. RESTful RSS
XML JSON
MIME
URI HTTP
SSL
19.6.2008 University of Milano Bicocca, Italy 7
©2008 Cesare Pautasso
Is REST being used?
Slide from Paul Downey, BT
19.6.2008 University of Milano Bicocca, Italy 8
©2008 Cesare Pautasso
3
- 4. Can we really compare
WS-* vs. REST?
WS-* REST
19.6.2008 University of Milano Bicocca, Italy 9
©2008 Cesare Pautasso
Can we really compare
WS-* vs. REST?
WS-* REST
Middleware Architectural
Interoperability style for
Standards the Web
19.6.2008 University of Milano Bicocca, Italy 10
©2008 Cesare Pautasso
4
- 5. How to compare?
ral
Architectu ng
odeli
D ecision M REST
WS-* Architectural
style for
Middleware the Web
Interoperability
Standards
19.6.2008 University of Milano Bicocca, Italy 11
©2008 Cesare Pautasso
Architectural Decisions
• Architectural decisions Architectural Decision:
capture the main design Communication Protocol
issues and the rationale
behind a chosen technical Architecture Alternatives:
solution 1. TCP
• The choice between 2. SMTP
REST vs. WS-* is an 3. HTTP
important architectural 4. MQ
decision for 5. BEEP
integration projects
6. CORBA IIOP
• Architectural decisions 7. …
affect one another
Rationale
19.6.2008 University of Milano Bicocca, Italy 12
©2008 Cesare Pautasso
5
- 6. Application Integration Styles
Shared Remote Message Bus File
Database Procedure Transfer
Call
REST WS-*
Integration Technology Platform
19.6.2008 University of Milano Bicocca, Italy 13
©2008 Cesare Pautasso
Related Decisions (WS-*)
Shared Remote Message Bus File
Database Procedure Transfer
Call
REST WS-*
19.6.2008 University of Milano Bicocca, Italy 14
©2008 Cesare Pautasso
6
- 7. Related Decisions (RPC)
Shared Remote Message Bus File
Database Procedure Transfer
Call
REST WS-*
19.6.2008 University of Milano Bicocca, Italy 15
©2008 Cesare Pautasso
Decision Space Overview
19.6.2008 University of Milano Bicocca, Italy 16
©2008 Cesare Pautasso
7
- 8. Outline
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-*
19.6.2008 University of Milano Bicocca, Italy 17
©2008 Cesare Pautasso
Architectural Principles
1. Protocol Layering
• HTTP = Application-level Protocol (REST)
• HTTP = Transport-level Protocol (WS-*)
2. Dealing with Heterogeneity
3. Loose Coupling
19.6.2008 University of Milano Bicocca, Italy 18
©2008 Cesare Pautasso
8
- 9. RESTful Web Service Example
HTTP Client Web Server Database
(Web Browser)
SELECT *
GET /book?ISBN=222 FROM books
WHERE isbn=222
POST /order INSERT
INTO orders
301 Location: /order/612
PUT /order/612 UPDATE orders
WHERE id=612
19.6.2008 University of Milano Bicocca, Italy 19
©2008 Cesare Pautasso
Big Web Service Example
(from REST perspective)
Web Service
HTTP Client Web Server
Implementation
(Stub Object)
POST /soap/endpoint
return getBook(222)
POST /soap/endpoint
return new Order()
POST /soap/endpoint
order.setCustomer(x)
19.6.2008 University of Milano Bicocca, Italy 20
©2008 Cesare Pautasso
9
- 10. Protocol Layering
• “The Web is the universe of globally • “The Web is the universal
accessible information” (tunneling) transport for messages”
(Tim Berners Lee) – Applications get a chance to
– Applications should publish their interact but they remain
data on the Web (through URI) “outside of the Web”
POX RSS JSON … SOAP (WS-*)
HTTP HTTP HTTP HTTP HTTP
SMTP MQ…
GET POST PUT DEL POST
Resource URI Endpoint URI
Application Application
19.6.2008 University of Milano Bicocca, Italy 21
©2008 Cesare Pautasso
Dealing with Heterogeneity
• Web Applications • Enterprise Computing
Picture from Eric Newcomer, IONA
HTTP
CICS
IMS
19.6.2008 University of Milano Bicocca, Italy 22
©2008 Cesare Pautasso
10
- 11. Conceptual Comparison
19.6.2008 University of Milano Bicocca, Italy 23
©2008 Cesare Pautasso
Technology Comparison
19.6.2008 University of Milano Bicocca, Italy 24
©2008 Cesare Pautasso
11
- 12. 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
REST WS-*
Decisions 17 14
Alternatives 27 35
Decisions with 1 or more alternative options
19.6.2008 University of Milano Bicocca, Italy 25
©2008 Cesare Pautasso
Measuring Complexity
REST WS-*
Decisions 5 12
Alternatives 16 32
Decisions with more than 1 alternative options
REST WS-*
Decisions 17 14
Alternatives 27 35
Decisions with 1 or more alternative options
19.6.2008 University of Milano Bicocca, Italy 26
©2008 Cesare Pautasso
12
- 13. Measuring Complexity
REST WS-*
Decisions 5 12
Alternatives 16 32
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 27
©2008 Cesare Pautasso
Measuring Complexity
REST WS-*
Decisions 5 12
Alternatives 16 32
Decisions with more than 1 alternative options
REST WS-*
Decisions 12 2
Decisions with only 1 alternative option
19.6.2008 University of Milano Bicocca, Italy 28
©2008 Cesare Pautasso
13
- 14. Measuring Complexity
• Payload Format
• Data Representation Modeling
REST WS-*
Decisions 12 2
Decisions with only 1 alternative option
19.6.2008 University of Milano Bicocca, Italy 29
©2008 Cesare Pautasso
Measuring Effort
REST WS-*
Do-it-yourself 5 0
Alternatives
Decisions with only do-it-yourself alternatives
REST WS-*
Decisions 12 2
Decisions with only 1 alternative option
19.6.2008 University of Milano Bicocca, Italy 30
©2008 Cesare Pautasso
14
- 15. Measuring Effort
REST WS-*
Do-it-yourself 5 0
Alternatives
Decisions with only do-it-yourself alternatives
• Resource Identification
• Resource Relationship
• Reliability
• Transactions
• Service Discovery
19.6.2008 University of Milano Bicocca, Italy 31
©2008 Cesare Pautasso
Freedom of Choice
Freedom from Choice
19.6.2008 University of Milano Bicocca, Italy 32
©2008 Cesare Pautasso
15
- 16. 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 33
©2008 Cesare Pautasso
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.
19.6.2008 University of Milano Bicocca, Italy 34
©2008 Cesare Pautasso
16
- 17. 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.
19.6.2008 University of Milano Bicocca, Italy 35
©2008 Cesare Pautasso
17