W3C home > Mailing lists > Public > public-wot-ig@w3.org > May 2016

How relevant is REST to rapidly changing sensor readings?

From: Dave Raggett <dsr@w3.org>
Date: Thu, 26 May 2016 13:36:26 +0200
Message-Id: <2C42AAEF-BE98-4E23-83E1-3C297E1DA1B6@w3.org>
To: Public Web of Things IG <public-wot-ig@w3.org>
I have been hacking away on an implementation of CoAP for the Arduino environment and am wondering just how relevant the idempotency properties of get, put and delete are to use cases involving rapidly changing sensor readings, especially, where each packet needs to transfer a block of sensor readings.

REST or representational state transfer assumes that requests transfer the state of the resource, but what does that mean when it is constantly changing? Consider a 3 axis accelerometer. The server path identifies the accelerometer, and get requests result in the most recent N samples. Each get request thus returns different data.  Perhaps we should use get? Should we instead use post for pulling or pushing such data?  CoAP’s observe capability allows a server to return a sequence of responses, and could be used to stream a sequence of blocks of sensor data. Likewise, you could use the HTTP chunked encoding for streaming blocks of sensor data as HTTP responses.

Perhaps REST isn’t a good fit, and we should avoid bending it to fit use cases for rapidly changing sensor readings?

   Dave Raggett <dsr@w3.org <mailto:dsr@w3.org>>

Received on Thursday, 26 May 2016 11:36:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:27:03 UTC