SlideShare a Scribd company logo
1 of 43
Download to read offline
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
1
REST vs. SOAP:
Making the Right
Architectural Decision
Cesare Pautasso
Faculty of Informatics
University of Lugano (USI), Switzerland
http://www.pautasso.info
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
2
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
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
3
Web Sites (1992)
HTTP
HTMLWeb
Browser
Web
Server
(HTTP)
SOAP
ServerClient XML
WSDL
WS-* Web Services (2000)
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
4
RESTful Web Services (2006)
Client
HTTP
PO-XML
RSS
JSON
Web
Server
WADL
WS-* Web Services (2000)
(HTTP)
SOAP
ServerClient XML
WSDL
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
5
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
6
XML
URI HTTP
MIME
JSON
RESTful
SSL
RSS
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
7
Is REST being used?
SlidefromPaulDowney,BT
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
8
Can we really compare
WS-* vs. REST?
WS-* REST
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
9
Can we really compare
WS-* vs. REST?
WS-*
SOA Middleware
Interoperability
Standards
REST
Architectural
style for
the Web
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
10
How to compare?
WS-*
SOA Middleware
Interoperability
Standards
REST
Architectural
style for
the Web
Architectural
Decision Modeling
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
11
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
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
12
Application Integration Styles
File
Transfer
Shared
Database
Message BusRemote
Procedure
Call
WS-*REST
Integration Technology Platform
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
13
Related Decisions (WS-*)
File
Transfer
Shared
Database
Message BusRemote
Procedure
Call
WS-*REST
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
14
Related Decisions (RPC)
File
Transfer
Shared
Database
Message BusRemote
Procedure
Call
WS-*REST
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
15
Decision Space Overview
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
16
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-*
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
17
Architectural Principles
1. Protocol Layering
• HTTP = Application-level Protocol (REST)
• HTTP = Transport-level Protocol (WS-*)
2. Dealing with Heterogeneity
3. Loose Coupling
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
18
RESTful Web Service Example
HTTP Client
(Web Browser)
Web Server Database
GET /book?ISBN=222
SELECT *
FROM books
WHERE isbn=222
POST /order INSERT
INTO orders
301 Location: /order/612
PUT /order/612 UPDATE orders
WHERE id=612
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
19
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
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
20
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
HTTP
POST
Application
Endpoint URI
POX
HTTP
GET
HTTP
PUT
HTTP
DEL
HTTP
POST
SOAP (WS-*)
MQ…SMTP
RSS JSON …
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
21
Dealing with Heterogeneity
CICS
IMS
PicturefromEricNewcomer,IONA
• Enterprise Computing
HTTP
• Web Applications
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
22
Conceptual Comparison
Note: this table
will scroll up
during the talk
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
23
Technology Comparison
Note: this table
will scroll up
during the talk
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
24
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
3527Alternatives
1417Decisions
WS-*REST
Decisions with 1 or more alternative options
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
25
Measuring Complexity
3527Alternatives
1417Decisions
WS-*REST
Decisions with 1 or more alternative options
3216Alternatives
125Decisions
WS-*REST
Decisions with more than 1 alternative options
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
26
Measuring Complexity
3216Alternatives
125Decisions
WS-*REST
Decisions with more than 1 alternative options
• URI Design
• Resource Interaction Semantics
• Payload Format
• Service Description
• Service Composition
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
27
Measuring Complexity
3216Alternatives
125Decisions
WS-*REST
Decisions with more than 1 alternative options
212Decisions
WS-*REST
Decisions with only 1 alternative option
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
28
Measuring Complexity
212Decisions
WS-*REST
Decisions with only 1 alternative option
• Payload Format
• Data Representation Modeling
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
29
Measuring Effort
212Decisions
WS-*REST
Decisions with only 1 alternative option
05Do-it-yourself
Alternatives
WS-*REST
Decisions with only do-it-yourself alternatives
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
30
Measuring Effort
05Do-it-yourself
Alternatives
WS-*REST
Decisions with only do-it-yourself alternatives
• Resource Identification
• Resource Relationship
• Reliability
• Transactions
• Service Discovery
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
31
Freedom of Choice
Freedom from Choice
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
32
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)
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
33
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.
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
34
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.
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
35
REST vs. SOAP:
Making the Right
Architectural Decision
Cesare Pautasso
Faculty of Informatics
University of Lugano (USI), Switzerland
http://www.pautasso.info
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
36
Backup Material
on REST
Cesare Pautasso
Faculty of Informatics
University of Lugano (USI), Switzerland
http://www.pautasso.info
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
37
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
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
38
URI: Uniform Resource Identifier
• Internet Standard for resource naming and identification
(originally from 1994, revised until 2005)
• Examples:
http://tools.ietf.org/html/rfc3986
https://www.google.ch/search?q=rest&start=10#1
• REST advocates the use of “nice” URIs
• In most HTTP stacks URIs cannot have arbitrary length (4Kb)
URI Scheme Authority Path
Query Fragment
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
39
What is a “nice” URI?
http://map.search.ch/lugano
http://maps.google.com/maps?f=q&hl=en&q=lugano,
+switzerland&layer=&ie=UTF8&z=12&om=1&iwloc=addr
http://maps.google.com/lugano
Prefer Nouns to Verbs
Keep them Short
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
40
Uniform Interface Principle
(CRUD Example)
DELETE
UPDATE
READ
CREATE
CRUD
Clear a resource,
after the URI is no
longer valid
Modify the state
of a resource
Retrieve the current
state of the resource
Initialize the state of a
new resource
at the given URI
DELETE
PUT
GET
POST/PUT
REST
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
41
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
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
42
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
3. Understand what it means to do a GET,
POST, PUT, DELETE on a given resource
URI
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
6. Implement and deploy on Web server
7. Test with a Web browser
XXX/soap
??/order
/book
?/client
XXX/balance
/loan
DELETE
POST
PUT
GET
7.10.2008 SOA Symposium 2008, Amsterdam
©2008 Cesare Pautasso
43
• 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”
Resource Representation
Formats: XML vs JSON

More Related Content

Viewers also liked

Yoda an accurate and scalable web based recommendation systems
Yoda an accurate and scalable web based recommendation systemsYoda an accurate and scalable web based recommendation systems
Yoda an accurate and scalable web based recommendation systemsAravindharamanan S
 
Visual studio-2012-product-guide
Visual studio-2012-product-guideVisual studio-2012-product-guide
Visual studio-2012-product-guideAravindharamanan S
 
Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...
Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...
Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...Aravindharamanan S
 
Toward the next generation of recommender systems
Toward the next generation of recommender systemsToward the next generation of recommender systems
Toward the next generation of recommender systemsAravindharamanan S
 

Viewers also liked (9)

Yoda an accurate and scalable web based recommendation systems
Yoda an accurate and scalable web based recommendation systemsYoda an accurate and scalable web based recommendation systems
Yoda an accurate and scalable web based recommendation systems
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
Recommender systems
Recommender systemsRecommender systems
Recommender systems
 
Xml+messaging+with+soap
Xml+messaging+with+soapXml+messaging+with+soap
Xml+messaging+with+soap
 
Soap binding survey
Soap binding surveySoap binding survey
Soap binding survey
 
Visual studio-2012-product-guide
Visual studio-2012-product-guideVisual studio-2012-product-guide
Visual studio-2012-product-guide
 
Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...
Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...
Big data -_14._maerz_mitarbeiterforschung_kundenevent_v2.pptx__schreibgeschue...
 
Toward the next generation of recommender systems
Toward the next generation of recommender systemsToward the next generation of recommender systems
Toward the next generation of recommender systems
 
Cs583 recommender-systems
Cs583 recommender-systemsCs583 recommender-systems
Cs583 recommender-systems
 

Similar to Soa amsterdam-restws-pautasso-talk

Cesare Pautasso R E S T V1
Cesare  Pautasso    R E S T V1Cesare  Pautasso    R E S T V1
Cesare Pautasso R E S T V1SOA Symposium
 
WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful ServicesCesare Pautasso
 
Next Generation_WVI
Next Generation_WVINext Generation_WVI
Next Generation_WVIPrasad Kapu
 
Slides: How to Select a PaaS
Slides: How to Select a PaaSSlides: How to Select a PaaS
Slides: How to Select a PaaSAltoros
 
Umit Yalcinalp Enterprise Mashupsfor S O A
Umit  Yalcinalp    Enterprise Mashupsfor S O AUmit  Yalcinalp    Enterprise Mashupsfor S O A
Umit Yalcinalp Enterprise Mashupsfor S O ASOA Symposium
 
REST API Guidelines.pdf
REST API Guidelines.pdfREST API Guidelines.pdf
REST API Guidelines.pdfNickNack8
 
Constraints Make You Sexy - What is Rest
Constraints Make You Sexy  - What is RestConstraints Make You Sexy  - What is Rest
Constraints Make You Sexy - What is Restanorqiu
 
Rest-Assured - легкий способ автоматизации тестирования REST
Rest-Assured - легкий способ автоматизации тестирования RESTRest-Assured - легкий способ автоматизации тестирования REST
Rest-Assured - легкий способ автоматизации тестирования RESTValtech Ukraine
 
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования RESTВладимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования RESTWeb Tech Fun
 
Net35 Overview
Net35 OverviewNet35 Overview
Net35 Overviewllangit
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate MemberCesare Pautasso
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?Vijay Prasad Gupta
 
Geoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbhGeoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbhRudolf Husar
 
Geoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbhGeoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbhguest480e30
 

Similar to Soa amsterdam-restws-pautasso-talk (20)

Cesare Pautasso R E S T V1
Cesare  Pautasso    R E S T V1Cesare  Pautasso    R E S T V1
Cesare Pautasso R E S T V1
 
REST vs. SOAP
REST vs. SOAPREST vs. SOAP
REST vs. SOAP
 
Www2008 Restws Pautasso Talk
Www2008 Restws Pautasso TalkWww2008 Restws Pautasso Talk
Www2008 Restws Pautasso Talk
 
WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful Services
 
Next Generation_WVI
Next Generation_WVINext Generation_WVI
Next Generation_WVI
 
Slides: How to Select a PaaS
Slides: How to Select a PaaSSlides: How to Select a PaaS
Slides: How to Select a PaaS
 
Bicocca Restws Pautasso Talk
Bicocca Restws Pautasso TalkBicocca Restws Pautasso Talk
Bicocca Restws Pautasso Talk
 
1213532535.pdf
1213532535.pdf1213532535.pdf
1213532535.pdf
 
MSDN Dec2007
MSDN Dec2007MSDN Dec2007
MSDN Dec2007
 
Umit Yalcinalp Enterprise Mashupsfor S O A
Umit  Yalcinalp    Enterprise Mashupsfor S O AUmit  Yalcinalp    Enterprise Mashupsfor S O A
Umit Yalcinalp Enterprise Mashupsfor S O A
 
Asp.net Overview
Asp.net OverviewAsp.net Overview
Asp.net Overview
 
REST API Guidelines.pdf
REST API Guidelines.pdfREST API Guidelines.pdf
REST API Guidelines.pdf
 
Constraints Make You Sexy - What is Rest
Constraints Make You Sexy  - What is RestConstraints Make You Sexy  - What is Rest
Constraints Make You Sexy - What is Rest
 
Rest-Assured - легкий способ автоматизации тестирования REST
Rest-Assured - легкий способ автоматизации тестирования RESTRest-Assured - легкий способ автоматизации тестирования REST
Rest-Assured - легкий способ автоматизации тестирования REST
 
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования RESTВладимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
Владимир Логвинов - Rest-Assured - легкий способ автоматизации тестирования REST
 
Net35 Overview
Net35 OverviewNet35 Overview
Net35 Overview
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate Member
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?
 
Geoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbhGeoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbh
 
Geoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbhGeoss Arch Schem 080326rbh
Geoss Arch Schem 080326rbh
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

Soa amsterdam-restws-pautasso-talk

  • 1. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 1 REST vs. SOAP: Making the Right Architectural Decision Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info
  • 2. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 2 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
  • 3. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 3 Web Sites (1992) HTTP HTMLWeb Browser Web Server (HTTP) SOAP ServerClient XML WSDL WS-* Web Services (2000)
  • 4. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 4 RESTful Web Services (2006) Client HTTP PO-XML RSS JSON Web Server WADL WS-* Web Services (2000) (HTTP) SOAP ServerClient XML WSDL
  • 5. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 5
  • 6. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 6 XML URI HTTP MIME JSON RESTful SSL RSS
  • 7. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 7 Is REST being used? SlidefromPaulDowney,BT
  • 8. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 8 Can we really compare WS-* vs. REST? WS-* REST
  • 9. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 9 Can we really compare WS-* vs. REST? WS-* SOA Middleware Interoperability Standards REST Architectural style for the Web
  • 10. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 10 How to compare? WS-* SOA Middleware Interoperability Standards REST Architectural style for the Web Architectural Decision Modeling
  • 11. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 11 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
  • 12. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 12 Application Integration Styles File Transfer Shared Database Message BusRemote Procedure Call WS-*REST Integration Technology Platform
  • 13. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 13 Related Decisions (WS-*) File Transfer Shared Database Message BusRemote Procedure Call WS-*REST
  • 14. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 14 Related Decisions (RPC) File Transfer Shared Database Message BusRemote Procedure Call WS-*REST
  • 15. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 15 Decision Space Overview
  • 16. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 16 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-*
  • 17. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 17 Architectural Principles 1. Protocol Layering • HTTP = Application-level Protocol (REST) • HTTP = Transport-level Protocol (WS-*) 2. Dealing with Heterogeneity 3. Loose Coupling
  • 18. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 18 RESTful Web Service Example HTTP Client (Web Browser) Web Server Database GET /book?ISBN=222 SELECT * FROM books WHERE isbn=222 POST /order INSERT INTO orders 301 Location: /order/612 PUT /order/612 UPDATE orders WHERE id=612
  • 19. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 19 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
  • 20. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 20 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 HTTP POST Application Endpoint URI POX HTTP GET HTTP PUT HTTP DEL HTTP POST SOAP (WS-*) MQ…SMTP RSS JSON …
  • 21. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 21 Dealing with Heterogeneity CICS IMS PicturefromEricNewcomer,IONA • Enterprise Computing HTTP • Web Applications
  • 22. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 22 Conceptual Comparison Note: this table will scroll up during the talk
  • 23. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 23 Technology Comparison Note: this table will scroll up during the talk
  • 24. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 24 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 3527Alternatives 1417Decisions WS-*REST Decisions with 1 or more alternative options
  • 25. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 25 Measuring Complexity 3527Alternatives 1417Decisions WS-*REST Decisions with 1 or more alternative options 3216Alternatives 125Decisions WS-*REST Decisions with more than 1 alternative options
  • 26. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 26 Measuring Complexity 3216Alternatives 125Decisions WS-*REST Decisions with more than 1 alternative options • URI Design • Resource Interaction Semantics • Payload Format • Service Description • Service Composition
  • 27. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 27 Measuring Complexity 3216Alternatives 125Decisions WS-*REST Decisions with more than 1 alternative options 212Decisions WS-*REST Decisions with only 1 alternative option
  • 28. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 28 Measuring Complexity 212Decisions WS-*REST Decisions with only 1 alternative option • Payload Format • Data Representation Modeling
  • 29. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 29 Measuring Effort 212Decisions WS-*REST Decisions with only 1 alternative option 05Do-it-yourself Alternatives WS-*REST Decisions with only do-it-yourself alternatives
  • 30. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 30 Measuring Effort 05Do-it-yourself Alternatives WS-*REST Decisions with only do-it-yourself alternatives • Resource Identification • Resource Relationship • Reliability • Transactions • Service Discovery
  • 31. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 31 Freedom of Choice Freedom from Choice
  • 32. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 32 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)
  • 33. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 33 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.
  • 34. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 34 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.
  • 35. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 35 REST vs. SOAP: Making the Right Architectural Decision Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info
  • 36. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 36 Backup Material on REST Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info
  • 37. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 37 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
  • 38. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 38 URI: Uniform Resource Identifier • Internet Standard for resource naming and identification (originally from 1994, revised until 2005) • Examples: http://tools.ietf.org/html/rfc3986 https://www.google.ch/search?q=rest&start=10#1 • REST advocates the use of “nice” URIs • In most HTTP stacks URIs cannot have arbitrary length (4Kb) URI Scheme Authority Path Query Fragment
  • 39. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 39 What is a “nice” URI? http://map.search.ch/lugano http://maps.google.com/maps?f=q&hl=en&q=lugano, +switzerland&layer=&ie=UTF8&z=12&om=1&iwloc=addr http://maps.google.com/lugano Prefer Nouns to Verbs Keep them Short
  • 40. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 40 Uniform Interface Principle (CRUD Example) DELETE UPDATE READ CREATE CRUD Clear a resource, after the URI is no longer valid Modify the state of a resource Retrieve the current state of the resource Initialize the state of a new resource at the given URI DELETE PUT GET POST/PUT REST
  • 41. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 41 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
  • 42. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 42 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 3. Understand what it means to do a GET, POST, PUT, DELETE on a given resource URI 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 6. Implement and deploy on Web server 7. Test with a Web browser XXX/soap ??/order /book ?/client XXX/balance /loan DELETE POST PUT GET
  • 43. 7.10.2008 SOA Symposium 2008, Amsterdam ©2008 Cesare Pautasso 43 • 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” Resource Representation Formats: XML vs JSON