I need to collect user data every few seconds where each user is unique. I've done some research and concluded that I should consider my data as time series data because I'm looking at how user behaviour changes over time. I want to use DynamoDB and in its best practices for time series doc, it describes creating a new table for each day, hour, minute, depending on convenience. In the example tables shown in the article, the partition key is the new-table-interval (e.g. the date) while the sort key is a smaller interval within it (e.g. seconds).
What I'm confused about is how to implement unique user ids in the database since I believe that every query made will be based on the user the data is for. Would it be wise to use a secondary index which includes the user id as a primary or sort key?