How relevant is REST to rapidly changing sensor readings?

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