aws-appsync-iot-core-realtime-example
aws-appsync-iot-core-realtime-example copied to clipboard
Is this cost effective?
This model pushes all of your IOT data through a lambda function and AppSync. Doing that may not be very cost efficient if you are making millions of IOT updates every day.
A useful extension to AppSync would be a built-in resolver that can do an AWS IOT subscribe. When the client asks for data AppSync would start the AWS IOT subscribe internally and record the received MQTT message as mutations, This model would be highly efficient since the IOT Subscribe could be written to only listen to relevant data. AppSync also knows the connection life cycle allowing it to tear the IOT Subscribe down when the mobile client disconnect.
This is proposed at the end of this forum message from 2018... https://forums.aws.amazon.com/thread.jspa?messageID=840951󍓷
Without direct AppSync support an alternative model is have the IOT rule write directly to DynamoDB. Then the app attaches to AWS IOT instead of AppSync and subscribes to the appropriate topic. The subscription allows the app to see the real-time data. Doing it this way avoids sending millions of records through AppSync when no one is listening. Of course this is much more messy in the app.
I agree with you, this solution is not cost-effective.