The Why Of REST
-
Upload
william-martinez-pomares -
Category
Technology
-
view
687 -
download
2
Transcript of The Why Of REST
![Page 1: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/1.jpg)
The Why ofREST
William Martínez PomaresArchitect and R&D ManagerAvantica Technologies [email protected]
![Page 2: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/2.jpg)
Who Am I and Why I’m Here?
![Page 3: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/3.jpg)
Agenda
REST What?
Application Types
The Constrain Trade-off
SOA Match Up
Suitability
![Page 4: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/4.jpg)
NO, REST is not…
RPC API
URI W.S.
PROTOCOL!
“An RPC protocol running over SOAP …”Charlie Kaufman and Ramanathan Venkatapathy - Windows Azure™
Security Overview
![Page 5: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/5.jpg)
YES, REST is….
“…architectural style for distributed hypermedia systems …”Roy Thomas Fielding, Architectural Styles and the Design of Network-based Software Architectures, 5
“to minimize latency and network communication, while at the same time maximizing the independence and scalability of
component implementations”Roy Thomas Fielding, Architectural Styles and the Design of Network-based Software Architectures, 5
![Page 6: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/6.jpg)
Styling Styles
STYLE DEFINITION
Name Context Forces Problem Solution Consequences
STYLE REST’S STYLE
“An architectural style is a coordinated set of architectural constraints that restricts the roles/features of architectural elements and the allowed relationships among those elements within any architecture that conforms to that style.”Roy Thomas Fielding, Architectural Styles and the Design of Network-based Software Architectures, 1.5
Play Analogy
![Page 7: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/7.jpg)
Application Types
Distributed
Networked
Integrated
![Page 8: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/8.jpg)
Distributed Application
Part 1
Part 2
Part 3
oApplication as a Wholeo Tight connectionsoHigh speed communicationo Strong couplingoReuse of Parts Optional
![Page 9: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/9.jpg)
Networked Application
Node 1
Node 2
Node 3
Node 4
Node 5
Node 6
oApplication as a Composition of Nodes
oWeak couplingoHigh cost
communicationoUser aware of
compositionoReuse of Parts is
common
![Page 10: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/10.jpg)
Integrated Application
App 1
App 2
App 3
oApplication as an Integration of Whole Applications
o Standard Interfaceso Low frequency of
interactionoHigher level processesoReuse of Parts is ruleo Large distribution
![Page 11: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/11.jpg)
The …ilities
Performance
Network
Latency
Scalability
Anarchic
Independent
Simplicity
Separation
Concerns
Principle of
Generality
![Page 12: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/12.jpg)
The …ilities
Modifiability
Evolvability/Extensibility
Customizability/
Configurability
Reusability
Visibility
Monitor
Mediate
Security
Portability
Standards
Mobility
Reliability
Redundancy
Fail safe
![Page 13: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/13.jpg)
Client Server
Server
Client
• Separation of Concerns• Improve Portability of UI• Scalability per simple
server components• Independent evolution
![Page 14: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/14.jpg)
Client Server
Server
Client
• Indirect cost of communication
• Concept degraded to hardware view
• Interaction Model may confuse Messaging with RPC
![Page 15: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/15.jpg)
CS + Stateless Communication
Server
Client
• No context in server, session in client
• All info needed is in message• Visibility: For Monitoring• Reliability: Partial recovery• Scalability: No server stored
session
![Page 16: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/16.jpg)
CS + Stateless Communication
Server
Client
• Decrease of performance due to increase on communication payload
• Takes away application control from server and places it into clients.
![Page 17: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/17.jpg)
CSSC + Cache
Server
Client
• Improves performance by decreasing interactions
• Reduces average latency.• Reduces processing on
server by reusing results of processed data.
• Can be multilevel
![Page 18: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/18.jpg)
CSSC + Cache
Server
Client
• Decrease of Reliability: Cached data may not be recently updated
• Implementation and storage cost
• Requires client awareness
![Page 19: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/19.jpg)
CSSCC + Uniform Interface
Server
Client
Server
• Principle of Generality on Interface
• Simple Architecture, better visibility
• Decoupling. • Adds Independent
Evolvability.
![Page 20: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/20.jpg)
CSSCC + Uniform Interface
Server
Client
Server
• Degrades Efficiency• Impedance Mismatch since
information is transferred in uniform format rather than most suitable.
• May add processing cost due to transformation
• Reduces visibility on Interface
![Page 21: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/21.jpg)
Uniform Interface: REST Case
Optimized for Large Grain Hypermedia Transfer
Identifiable Resource concept Manipulation of resources by
representations Self-descriptive messages Hypermedia as the engine of application
state
![Page 22: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/22.jpg)
The SOA Case
Legacy Heterogeneous Complex Imperfect RedundantBusiness service, process
oriented
Nicolai M. Josuttis, SOA in Practice, OREILLY
Large Distributed Systems
![Page 23: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/23.jpg)
SOA – Process Oriented
Messaging: Send data to a service for processing. RPC?
No operation in protocol Business as a process, not as data Processes as resources Discoverable by repository,
centralized No flow control. External or out of
band Business semantics
![Page 24: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/24.jpg)
REST – Hypermedia Oriented
Messaging: Send/Receive representation. No RPC.
Finite Operation set in protocol Not about business Datum as resources Discoverable by link, distributed Hypermedia as the State Engine Mixed semantics
![Page 25: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/25.jpg)
SOA – REST Match Up
Different types of applications REST as Special Service construction
architecture Large distributed data Hypermedia related or Insensible to format
transformation. Relaxed Security Independent evolution requirement Non processing intensive Non sensitive to performance hits, cacheable.
![Page 26: The Why Of REST](https://reader035.fdocuments.in/reader035/viewer/2022062418/5562182fd8b42acb1e8b51da/html5/thumbnails/26.jpg)
QUESTIONS?