I have a web application that contains products and users. There are 10,000+ products and 100,000+ users to give a sense of the scale that's required.
For some application specific reasons, I need to track which products have been seen by which users. For example, Productid1 was seen by User1 but not Productid3000.
I'm thinking of a solution using MySQL where I would add another table called "Seen Products" having two columns: ProductId and UserId. Any time a product is seen by a user, I would add a new row to this table. To see whether a product has been seen by a user, I would then check the first ProductId in my Product table that is not in the Seen Table for a particular user.
However, I'm worried about the scalability of calling this multiple times (50+) per user in a user session. Would MySQL tables be fast/scalable enough to achieve this task? What would an optimal way to achieve this requirement?
Edit: Updating this post to add that this data will be used to display a subset (~10) of products to the user which they have not previously been shown before. So, it is a user-facing feature rather than analytics. Therefore, the database "reads" happen to answer the question: "What are 10 products that the user has not seen before?" and this query will be used during the user's session to show those products!