I have a device using AWS IOT that is saving the information on a Dynamodb table. It's not a lot of info, just water flow from my second house. My intention is to "turn on" a flag that will alarm me if I have a water leak. I was studying some alternatives (IoT alerts, cloudwatch metrics, etc) but since I want to specify different situations for alarm (weekends, 24 hours, only nights etc), I was thinking to build an app and run as a service in an EC2 instance that I already have.
My idea for this app/service is to check if there is any kind of alarm set up, and depending on the configuration, query the DB to find any leak information - every 5 minutes for example.
In the case I turn this on 24x7, how inefficient and costly would this query process every 5 minutes be? It would be a query with parameters to get the last few minutes.
My table is configured with a partition key for each day, and a sort key in the Date/time format (which I would use for the query).
Any suggestions?
thanks in advance.
I didn't try too much - I'm still studying alternatives.