I need to create a table that will contain a piece of data created by a continuously running process. This process generates messages that contain, among other things, two required components: a globally unique message UUID and a message timestamp.
These messages will later be received by the UUID.
In addition, on a regular basis, I will need to delete all messages from an too old old table, i.e. timestamps of which are greater than X from the current time.
I read the DynamoDB v2 documentation (e.g. Local Secondary Indexes ), trying to figure out how to organize my table and whether I need an additional index to search for messages to delete . There may be a simple answer to my question, but I'm somehow confused ...
So should I just create a table with a UUID as a hash and messageTimestamp as a range key (along with the message attribute that will contain the actual message) and then not create any secondary indexes? In the examples I saw, the hash was something unique (for example, ForumName at the link above). In my case, the hash will be unique. I'm not sure what that matters.
And if I create a table with a hash and a range, as described, and without a secondary index, then how would I request all messages that are in a specific timer, regardless of their UUID?
source share