1
votes

I am trying to a reliable way to send data from aws lambda function to a aws iot thing. The thing is basically a raspberry pi which is located remotely.

I have seen aws iot topics, but they don't seem to be reliable for my use case.

So far I have found the following functionalities about topics

Topics:

  • Topics are asynchronous.
  • When something is added to topic all and only currently listening devices will receive the update.
  • There is no queueing.
  • No delivery notification for the publisher.

In my use case I need to know if the delivery is made(retry otherwise), but if the device is not connected, the topic might lose the write.

Is there a way to solve this issue. Any help is much appreciated.

Edit:

What I am trying to do is send data about a user who can interact with the device from a remote server.

To over come the limitation of topic for my use case I came up with the following solution.

Step 1: Dynamo -> lambda1 -> sqs -> topic1 -> remote device

Step 2: remote device(after getting the data) -> topic2(acknowledgement) -> lambda2(delete message from sqs) -> Update DB about action

Does this solution seem reliable?

Edit 2:

Basically I am trying to send all the updates made to a DB to IOT Thing.

Based on answer from @dvd86,

Step 1: DynamoStream -> lambda1 -> sqs -> Thing shadow desired

Step 2: shadow reported updated -> lambda2(delete message from sqs) -> Update DB about action

1
You can do this, but this is not recommended for IOT devices. You'll have to either use a per device queue or some database tracking all devices. What's your use case?vidit
What I am trying to do is send data about a user who can interact with the device from a remote server. To over come the limitation of topic for my use case I came up with the following solution. 1) lambda1 -> sqs -> topic1 -> remote device 2) remote device(after getting the data) -> topic2(acknowledgement) -> lambda2(delete message from sqs Is there any flaw in the above solution?tharun

1 Answers

1
votes

Your solution is not recommend because there is a lot of troubles that you are going to have to implement yourself that Aws iot already implemented.

Your answer for this scenario is using AWS IoT shadow: https://docs.aws.amazon.com/iot/latest/developerguide/using-thing-shadows.html