I'm trying to figure out how to model the following data in AWS DynamoDB table.
I have a lot of IOT devices, each sends telemetry data every few seconds.
Attributes
- device_id
- timestamp
- malware_name
- company_name
- action_performed (two possible values)
Queries
- Show all incidents that happened in the last week.
- Show all incidents for a specific device_id.
- Show all incidents with action "unable_to_remove".
- show all incidents related to specific malware.
- Show all incidents related to specific company.
Thoughts
I understand that I can add GSI's for each attribute, but I would like to use GSI's only if there is no other choice as it costs me more money.
What would be the main primary-key (partition-key:sort-key) ?
Please share you thoughts, I care about them more than I care about the perfect answer as I'm trying to learn how to think and what to consider instead of having an answer for a specific question.
Thanks a lot !