Skip to main content
1 of 2

Designing a database for "not seen" queries

I'm building a large collection of items from which I want to query items that a specific user has not seen before. I will need to track, per user, which items s/he has seen.

Currently the items are stored in mongodb and the 'seen items' I am planning to store in a mysql database.

I have two questions:

  1. How should I design the database of items in order to effectively query for items a certain user has not seen?
  2. As each user can have 'seen' several thousand items, should each user have its own mysql table or should I just have one large table?