Internet-Draft | The Series Transfer Pattern (STP) | April 2020 |
Bormann & Hartke | Expires 10 October 2020 | [Page] |
Many applications make use of Series of data items, i.e., an array of data items where new items can be added over time. Where such Series are to be made available using REST protocols such as CoAP or HTTP, the Series has to be mapped into a structure of one or more resources and a protocol for a client to obtain the Series and to learn about new items.¶
Various protocols have been standardized that make Series-shaped data available, with rather different properties and objectives. The present document is an attempt to extract a common underlying pattern and to define media types and an access scheme that can be used right away for further protocols that provide Series-shaped data.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 10 October 2020.¶
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
(TO DO: Insert an extended form of the abstract first here, expanding the reference to [RFC7230] and [RFC7252] in the process.)¶
Examples for protocols that provide Series-shaped data are:¶
[I-D.birkholz-yang-push-coap-problemstatement] is a problem statement that will require the design of another scheme to transfer Series-shaped data.¶
Series transfer applications may have rather different objectives.¶
In general, minimizing latency and ensuring completeness are competing objectives.¶
Series transfer environments sometimes centralize information distribution functions, leading to "broker" architectures (often combined with the "publish/subscribe" pattern). With brokers, Series publishers may use an entirely different interface to the brokers from that used by the receiving clients, or the interfaces can be designed so they are similar for all the forwarding steps.¶
A series of items can be represented by a single collection resource:¶
While this is adequate in many cases, it has a number of limitations:¶
In the Browser Web, it is usual to provide Pagination for collection resources that can grow large (e.g., search results):¶
Without modification, this does not work well for resources that actually change by themselves: Once a new page needs to be added, what previously was page 1 now becomes page 2. Obviously, the naming of pages better remains unchanged with new pages added a the front.¶
However, now the client has no idea what initial page to request to get the freshest items and the head of the list. It is easy to add a link to the freshest page:¶
The head of the linked list can now be simply observed; the addition of pages will then be notified to the observer.¶
As usual in series transfer, the following considerations remain:¶
When can the server decide to no longer retain older items?¶
The link head can also include items that have so far not been added to pages; this can be used to fill up pages evenly without them ever changing. Obviously, the best number of items to prenotify in this way as well as the best time to open a new page are different for different applications.¶
A GET on a resource representing a Series may return a collection item that contains the following pieces of information¶
An array of Series items, either as an array of media-typed objects in a suitable representation format (e.g., CBOR, MIME) or by using an array-like media type (e.g., SenML).¶
In Figure 5, the cursor is implemented as a URI that can be used as a link to the next page.¶
A GET may be enhanced with additional parameters (possibly turning it into a FETCH):¶
A server may implement a form of custody transfer by interpreting the cursor as an acknowledgement that the client has received all data up to the cursor. This is not necessarily acting as an unsafe request ("destructive GET"), as other clients may be active that have not yet received all these data. To implement a full custody semantics, the server needs to be aware of all the clients that expect a full Series Transfer (a classical group management problem).¶
(Explain how Observe can help. Can it?)¶
This memo registers a number of media types: TO DO.¶
TO DO¶
The need for a Series Transfer Pattern has been made clear by a number of people that contribute to the IRTF Thing-to-Thing Research Group (T2TRG), e.g. Matthias Kovatsch and Henk Birkholz (both of whom also provided feedback on an early draft). Henk also contributed further examples for the use of Series Transfers in protocols.¶