Representational State Transfer (REST)
Please read the applicable Terms of Use.
Description
REST is an API architecture principle, first described in 2000.
Compared to more traditional API architectures (service-oriented architectures - SOA) which are function-driven, REST is resource-oriented: instead of defining processes, RESTful APIs rely on the manipulation of resources (i.e. data itself). This means that, instead of calling a specific process, one of the CRUD operations (create, read, update, delete) is performed on a resource.
Each resource is uniquely identified by a URI. A core feature of RESTful APIs, the HATEOAS concept (Hypermedia As The Engine Of Application State), relies on these URIs: hyperlinks can be used to provide further information (where to find additional resources) or available actions (e.g. how to book after shopping).
Performance and practicality
Regarding the definition of an API, the REST architecture shifts the complexity from processes (what can be done) to resources (what can be manipulated). There is no universal better way: it depends on the context.
The HATEOAS concept allows for smaller messages (thanks to the use of references instead of complete values), but this usually is at the expense of the number of request/response exchanges. It can also help determine what the next steps are, and how to proceed.
The use of HTTP status codes (such as "200 - OK" and "404 - Not Found") simplifies the interpretation of a response with a simple overview of the outcome of a request (e.g. resources successfully created or modified, insufficient privileges, server error): in some cases, this eliminates the need to interpret the full response.
Applicability to NDC & ONE Order
With current NDC and ONE Order schemas, the structure of each message encapsulates the business logic underpinning the process performed through that message. Because of the focus shift from processes to resources that REST entails, the processes are broken down into smaller functions, and part of the business logic is lost. This means a truly RESTful NDC API concept would be a different standard altogether.
In general, REST is more suitable for simpler APIs, whereas service-oriented architectures are a better fit for more complex business-to-business scenarios such as NDC.
A more complete study is available in this report (section 2).
Key references
- Study of Web Services Paradigms (alongside Data Formats and GraphQL)
- Roy Fielding's dissertation: REST definition
- IBM developerWorks: RESTful web services: the basics
- SoapUI: SOAP vs REST
- YouTube (WebConcepts): REST API concepts and examples