Reading previous IoT device data , cache redis or table storage?

djoshi 1 Reputation point
2022-08-24T18:39:05.103+00:00

Hi All

I have Azure Function that is triggered every time I have an IoT Hub message.

I need also to read the previous message to see if any specific operations have changed.

Would it be better to use Table Storage or Redis cache?

This would mean that we would need to save some messages in some form of memory.

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
156 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,309 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,127 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde 28,956 Reputation points MVP
    2022-08-24T21:47:10.76+00:00

    Hello @djoshi ,

    you want to compare each incoming IoT Hub message with the previous message.

    Azure Functions are stateless so you need some kind of 'state' (the last message seen) so you can compare it.

    Table Storage and Redis cache are both valid solutions to be combined with Azure Functions although I personally prefer the Azure Storage tables binding.

    Are you aware this can also be done using Azure Stream Analytics? Check out the LAG functionality as seen in this blog post.

    ----------

    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. By doing so, all community members who have a similar issue will benefit. Your contribution is highly appreciated.

    0 comments No comments