Top Banner
The Why of REST William Martínez Pomares Architect and R&D Manager Avantica Technologies [email protected]
26
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Why Of REST

The Why ofREST

William Martínez PomaresArchitect and R&D ManagerAvantica Technologies [email protected]

Page 2: The Why Of REST

Who Am I and Why I’m Here?

Page 3: The Why Of REST

Agenda

REST What?

Application Types

The Constrain Trade-off

SOA Match Up

Suitability

Page 4: The Why Of REST

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

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

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

Application Types

Distributed

Networked

Integrated

Page 8: The Why Of REST

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

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

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

The …ilities

Performance

Network

Latency

Scalability

Anarchic

Independent

Simplicity

Separation

Concerns

Principle of

Generality

Page 12: The Why Of REST

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

Client Server

Server

Client

• Separation of Concerns• Improve Portability of UI• Scalability per simple

server components• Independent evolution

Page 14: The Why Of REST

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

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

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

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

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

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

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

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

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

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

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

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

QUESTIONS?