I am building an application using AWS Mobile HUD and connected services, most prominently Cognito & DynamoDB. Currently I am facing a problem to setup a scheme that allows me to store user-related information on DynamoDB items (or vice versa).
Scenario
Run 1
- User A pulls list of
[RootItem] = {RootItem_1, RootItem_2, RootItem_3}from DynamoDB (check: works fine) - User A either dismisses
RootItem_1(mark as 'not interested' in app)
Run 2
- User A logs into the application
- User A pulls list of
[RootItem] = {} - User A should only get
RootItemswhich are not dismissed - List delivered to client should be
{RootItem_2, RootItem_3}
Being new to non-relational data / NoSQL, I am not sure what is the best way to approach this. Possible Ideas:
- Store userID on the RootItem_1 to exclude it in Scan [issue: there will potentially be thousands of users dismissing the same item]
- Store uuid of RootItem_1 to userdata on cognito, cache locally before pull and exclude uuid's from pull
- Create table with exclusions/dismissions [userid, rootItem_uuid], query this first to get list of user exclusions. > potential performance issue?
It would be great to get some advice what is the best approach to handle this in a NoSQL environment.