Representational State Transfer: An Architectural Style For Distributed Hypermedia Interaction
Representational State Transfer: An Architectural Style For Distributed Hypermedia Interaction
Roy T. Fielding
University of California, Irvine
http://www.ics.uci.edu/~fielding/
Network Application Architecture
Software architecture of a network-based app
– abstract system view and model for comparison
– communication restricted to message passing
Defines
– how system components are allocated and identified
– how the components interact to form a system
– the amount and granularity of communication needed
for interaction
– interface protocols
Network Performance Measures
latency
– latent period: time between stimulus and first
indication of a response
– minimum latency = ping/echo time
throughput
– rate of data transfer
round trips
– number of interactions per user action
Network Performance Measures
overhead
– setup: time to enable application-level interaction
– message control
amortization
– spreading overhead across many interactions
completion =
setup / amortization
+ (roundtrips * latency)
+ (control + data) / throughput
User-perceived Performance
user-perceived latency impacted by
– setup overhead
– network distance x round trips
– blocking/multithreading
– collisions
user-perceived throughput impacted by
– available network bandwidth
– message control overhead
– message buffering, layer mismatches
– loss of synchronization
Network Application Performance
application style architecture implementation
Network performance is bound by
– application requirements
– pattern of communication
– infrastructure used to communicate
– implementation of components
The best network application performance
is obtained by not using the network
– disconnected operation
Architectural Styles
Common patterns within system architectures
One system may be composed of multiple styles
Some styles are hybrids of other styles
An architecture is an instantiation of a style
We could equally talk about
– computer architecture
– network architecture
– software architecture [Shaw/Garlan, 1993]
network-based application architecture
Client/Server
No Extensibility
– only one method (GET)
– no request modifiers
– no response metadata
HTTP/1.0 (1993-present)
HTTP/1.1 200 OK
Date: Fri, 07 Jan 1997 15:40:09 GMT
Server: Apache/1.2b6
Content-type: text/html
Transfer-Encoding: chunked
Etag: “a797cd-465af”
Cache-control: max-age=3600
Vary: Accept-Language
…
HTTP/1.x Deficiencies
MIME is too verbose (overhead per message)
Control mixed with metadata
Metadata restricted to header or trailer
Meta-metadata requires encapsulation of entire
message
Fixed request/response ordering can block
progress
Lack of multiplexing prevents getting important
part of multiple representations first
HTTP/2.x
Tokenized transfer of common fields
– reducing bandwidth usage, latency
– removal of MIME syntax limitations
– self-descriptive for extensions
Multiplexing control, data, metadata streams
– reducing desire for multiple connections
– enabling multi-protocol connections
– per-stream priority or credit mechanism
Layered streams for meta-metadata, encryption...
Media Types
Web architecture is designed to be media type
independent
– but we can only use what agents will consume
– leading to a chicken-and-egg adoption problem
HTML is still the lingua franca
– difficult to extend semantics, rendering
– wasteful to extend syntactically
– no mechanism for alternatives
ECMAscript, DynamicHTML, applets
XML to the rescue?
“X” for extensible:
– self-descriptive syntax
– semantics by reference (doctype, namespaces)
– rendering by reference (style sheets)
An XML representation is an object turned
inside-out, with behavior-by-reference
However, network application performance will
demand standards for domain-specific doctypes
and style sheets
Conclusions
Web architectural style inherits from
– client/server: separation of concerns, scalability
– pipe-and-filter: streams, intermediaries, encapsulation
– distributed objects: methods, message structure
Advantages of representational state transfer:
– application state controlled by the user agent
– composed of representations from multiple servers
– representations can be cached, shared
– matches hypermedia interaction model of combining
information and control
Future Work
Dynamic application architectures
Architectural analysis and performance bounds
Impact of future network architectures (ATM)
Balancing secure transfer with firewall visibility
Protocol for manipulating resource mappings
HTTP-NG (W3C/Xerox PARC)
rHTTP (UCI)
Questions?