I'm coming from a strong relational database background and am having trouble understanding hash and range and secondary indexing in DynamoDB.
I'm looking to store notifications for users.
In SQL, the columns would be :
- NotificationID (PK)
- UserID (FK)
- Message
- DateCreated
- DateViewed
I need help setting up the proper hash and range keys so this works properly in the following tasks
- querying or scanning to find the latest notifications for a LIST of userIDs. This list will be dictated by which users are actually logged in at the moment. Equivalent to "WHERE userID IN (1,2,3)" in SQL
- get count of notifications where dateViewed = '1/1/1900'
- update specific notification
- get all notifications for a particular user
Any help on structuring this table correctly is appreciated