Representational State Transfer

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights
System Wide Information Management (SWIM)
REST - Representational State Transfer
REST & SOAP Peter Drayton
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Introduction to Web Services
Server Access The REST of the Story David Cleary
REST (Representational State Transfer)
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
Building RESTful Interfaces
Web Services Seminar: Service Description Languages
Thoughts on Architecture for the Internet of Things Group Name: Working Group 2 - Architecture Source: Nicolas Damour, Sierra Wireless
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
Controling instrument in the RESTful way
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Service YU-RONG CHEN June 5 th Outline Web Service – SOAP – WSDL – UDDI – Implementation RESTful Web Service – REST – Example – Implementation.
Web Architecture & Services (2) Representational State Transfer (REST)
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Prepared By : Monika Darji Web Services using REST & JAX-WS.
RESTful applications Norman White. REST Representational state transfer Key concepts – Client Server architecture built on transferring resources between.
Web Services XML-RPC, SOAP, REST Advanced Web-based Systems | Misbhauddin.
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
A Limited Definition of Web Services Paul Kopacz CIS* Service Oriented Architecture Instructor: Qusay H. Mahmoud, Ph.D. February.
1 Seminar on Service Oriented Architecture Principles of REST.
Web Architecture update for WSAWG/WSDL TAG published Principles of the Web Contents: –Identifiers Most of the work –Formats Not much –Protocols Summary.
Advanced Web Technologies Lecture #4 By: Faraz Ahmed.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
RESTful Web Services What is RESTful?
REST By: Vishwanath Vineet.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
REST REPRESENTATIONAL STATE TRANSFER Scott Ainsworth & Louis Nguyen (Group 1) Old Dominion University, CS 791: Web Syndication Formats, January 29, 2008.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
Intro to REST Joe Gregorio Google. REST is an Architectural Style.
National College of Science & Information Technology.
REST in Practice COMP6017 Topics on Web Services Dr Nicholas Gibbins –
COMS E6125 Web-enHanced Information Management (WHIM)
API (Application Program Interface)
Thoughts on Architecture for the Internet of Things
RESTful Sevices Distributed Objects Presented by: Shivank Malik
Better RESTFul API – Best Practices
OpenInsight as a REST API Engine
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
WEB SERVICES.
REST: Web Services Abel Sanchez.
REST- Representational State Transfer Enn Õunapuu
Unit – 5 JAVA Web Services
Advanced Web-based Systems | Misbhauddin
Hypertext Transfer Protocol
Ashish Pandit IT Architect, Middleware & Integration Services
WEB API.
Ashish Pandit, Louis Zelus, Jonathan Whitman
COMP3220 Web Infrastructure COMP6218 Web Architecture
$, $$, $$$ API testing Edition
Service-Oriented Computing: Semantics, Processes, Agents
A gentle introduction to RESTful APIs
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
REST på Microsoft-stacken
WEB SERVICES From Chapter 19, Distributed Systems
Service-Oriented Computing: Semantics, Processes, Agents
A gentle introduction to RESTful APIs
Chengyu Sun California State University, Los Angeles
REST API Design Borrowed heavily from:
Presentation transcript:

Representational State Transfer COMP3220 Web Infrastructure COMP6218 Web Architecture Dr Nicholas Gibbins – nmg@ecs.soton.ac.uk 2017-2018

Representational State Transfer Original design for the Web did not have a formal architecture Network issues with early HTTP (0.9/1.0) affected scalability Nature of application interactions on the Web changed (images, etc) Limited support for shared caching Architectural style that parallels and informs the design of HTTP/1.1 Described in a thesis by Roy Fielding (Day Software, co-founder of the Apache Software Foundation, co-author of HTTP and URI RFCs) stateless – no client context stored on server cacheable – responses may be cached layered – intermediaries are transparent uniform interface – resources, manipulation through representations, self-descriptive messages, HATEOAS

REST Constraints

Constraints – Client-Server Separation of concerns: user interface (client) data storage (server) Improves portability of user interface Improves scalability by simplifying server Allows components to evolve separately

Constraints – Stateless Each request from client to server must contain all of the information necessary to understand the request No context is stored on the server Session state is kept entirely on the client Improves visibility (can consider each request in isolation) Improves reliability (easier to recover from partial failures) Improves scalability (reduces server resource usage) Increases per-interaction overhead

Constraints – Caching Response data must be labelled as cacheable or non-cacheable If cacheable, client may reuse response data for later requests Allows some interactions to be eliminated Reduces average latency of interactions Stale data reduces reliability

Constraints – Uniform Interface Uniform interface between components Identification of resources Manipulation of resources through representations Self-descriptive messages Hypermedia as the engine of application state (HATEOAS) Improves visibility of interactions Encourages independent evolvability Degrades efficiency (depending on optimisation)

Constraints – Layered System System components have no knowledge of components beyond those with which they directly interact Encapsulate legacy services Introduce intermediaries Limits system complexity Improves scalability (load balancing) Adds latency and overhead (offset by caching)

Constraints – Code on Demand (optional) Client functionality extended by downloading and executing code Applets Scripts Improves extensibility Reduces visibility

Architectural Elements

Data Elements Resources, Identifiers, Representations URIs, HTML, etc Representation metadata Media type, Last-Modified Control data If-Modified-Since, Cache-Control

Components Origin server Gateway Proxy User agent Definitive source of resource representations Web server: Apache, nginx, IIS, etc Gateway Intermediary selected by origin server Proxy Intermediary selected by client User agent Browser: Chrome, IE, Safari, Firefox, etc Origin server – definitive source for resource representations User agent - browser

Connectors Client: libwww, etc Server: libwww, Apache API, etc Cache: local or shared (c.f. Akamai) Resolver: Bind/DNS, DDDS Tunnel: HTTP CONNECT + SSL/TLS, SOCKS Encapsulate activities of accessing resources and transferring resource representations - Statelessness is key client – libwww, etc server – apache api, etc resolver – bind/DNS – translates resource identifiers DDDS Dynamic Delegation Discovery System RFC 3401 tunnel – SOCKS, SSL – proxies

Further Reading Architectural Styles and the Design of Network-based Software Architectures (Ch 4-6) http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

RESTful Web Services

REST beyond the Web architecture “Traditional” Web Services based on W3C Web Services Architecture (+WS-I, etc) SOAP, WSDL, UDDI, etc REST based on W3C Web Architecture Apply the REST constraints to the design of Web Services Better fit between the two architectures

The Richardson Maturity Model Model of RESTful maturity REST constraints made concrete, in context of Web technology stack Hypermedia HTTP URI Compare with identity, interaction, representation

Level Zero Hypermedia HTTP URI Single well-known endpoint Uses HTTP as a transport only No hypermedia Hypermedia HTTP URI

Level Zero in Practice XML-RPC Most SOAP services POX

POX: Plain Old XML over HTTP Use HTTP POST to transfer XML documents between systems SOAP-like, without SOAP headers, etc Platform independent Uses HTTP as a transport protocol, not an application protocol HTTP metadata is ignored

Level One Hypermedia HTTP URI Multiple endpoints Uses HTTP as a transport only (single verb) No hypermedia Hypermedia HTTP URI

Templates and Tunnelling URI templates http://restbucks.com/order/{order_id} URI tunneling Use GET for safe/idempotent operations Use POST otherwise Map existing method parameters to URI query parameters http://restbucks.com/PlaceOrder?coffee=latte&size=large Elaboration of intuitive URIs Increases tight coupling safe – no side effects idempotent – absolute side effect

URI Tunnelling Sometimes Web-friendly Multiple URIs used to name resources (Sometimes) correct use of GET but URIs used to encode operations, rather than identify resources Use of GET for non-safe operations breaches Web Architecture principle of Safe Retrieval

Level Two Hypermedia HTTP URI Multiple endpoints, identifying resources Understands HTTP (multiple verbs) No hypermedia Hypermedia HTTP URI

Mapping CRUD to HTTP Operation HTTP Verb Create POST to a URI, creates new subordinate resource Read GET, returns representation Update PUT, providing new representation Delete DELETE, removes resource

Level Three Hypermedia HTTP URI Multiple endpoints, identifying resources Understands HTTP (multiple verbs) Uses links to communicate protocols (shared state) Hypermedia HTTP URI

HATEOAS Hypermedia as the engine of application state Resource representations include links to related resources Links that represent a transition to a possible future state of the current resource Link types used to indicate operations (HTTP verbs) that may be used on the indicated resources State transitions constitute application protocol

Next Lecture: REST in Practice