give it a rest already arnon rotem-gal-oz vp r&d xsights

31
Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights www.xsights.com www.rgoarchitects.com/nblog

Upload: rebecca-connolly

Post on 27-Mar-2015

221 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Give it a REST already

Arnon Rotem-Gal-OzVP R&D xsights

www.xsights.comwww.rgoarchitects.com/nblog

Page 2: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

SomeTheory

Page 3: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Making sense of the terminology soup

Code/Detailed Design

Design

Design Patterns Architecture

Architectural PatternsArchitectural Styles

Page 4: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

SOA vs. RESTPipes and

FiltersClient Server

Uniform Interface

Virtual Machine

DistributedAgents

LayeredSystem

Replicated Repository

Code OnDemand

StatelessComm. Cacheable

RESTSOA

Page 5: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST = "Representation State Transfer"

Dispatcher

WebApp

Cache(Resource)

Put (New State in XML)

OK

Get (Latest State)

Representation(JSON)

Page 6: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Layers should have some constraints on communications

Layer?

Layer?

Layer?

Layer?

Page 7: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Layer

Layers should have some constraints on communications

Component

Component

Layer

Componet

Page 8: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Client/Server

Client Server

Capabilities (services)Requests initiator

Request

Reply

Page 9: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Replicated Repository is about having

more than one copy providing

the same service looks like one copy

better performance and latency

copy

copy

copy

copy

copy

copy

copy

copy

copy

Page 10: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

The uniform interface

Page 11: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Document Centric messages provide

the client with the needed state

and allow stateless

communications

Page 12: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST also externalize state transitions

Page 13: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Use IDs that are linkse.g. a

Page 14: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Technology Mapping

Page 15: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

HTTP is the most common REST implementation

Page 16: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

But you can create others

Waka canoe

Page 17: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

GET = query/read a resource for a representation

Page 18: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

PUT = create with ID set by the

client / replace

Page 19: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

POST = Create a subordinate resource with ID set by server / update

Page 20: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

DELETE= remove the URI (most likely delete the resource)

Page 21: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

HEAD = GET but only retrieves

metadata (headers)

Page 22: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

OPTIONS – The currently available

verbs / requirements for communication

Page 23: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Why REST?

Page 24: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Example – Resource Manager

Page 25: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

http://devrig:52141/RM/Sessions/abc/

• ATOMPUB– Session details• URI (ID)• State (start/end/status etc.)• Resources

– Knows status– URI for the Resource representation on the RM– URI for the Resource itself

Page 26: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

Common REST misconceptions

Page 27: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST = CRUD

Page 28: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST is the ultimate architecture

Page 29: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST = HTTP

Page 30: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST will automagically make you write perfect distributed systems

Page 31: Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights

REST is Simpler