I'm currently designing a DynamoDB pattern I don't know if I'm on the right track or not.
I have the following data I need to store into a DynamoDB table:
- deviceID (number)
- deviceLogType (string)
- timestamp (number) // timestsamp is in utc seconds
- other misc attributes
The primary query for this DynamoDB table is to query the data by both deviceID and deviceLogType over a time range. Is
Partition Key : deviceLogType_deviceID
Sort Key : timestamp
My questions are:
- Is the above design correct?
- Is it within the best practice to use composite key for partition key to represent hierarchical relations?