Database design for tracking updates since last visit

I am creating a database for the kind of Forum application. Use cases include showing unread topics to the user. Therefore, I need to track the read / unread status for each message for each user ID.

I have a table of users and messages. I think I should create a table "Read_Posts" with the user ID and postid, so I can add that each user of the message saw this table. But over time, this table will become very large.

Any other alternative approaches to this?

Thank!

+3
source share
3 answers

Your design seems right.

, , , ( - ), ( , ).

10 ...

+2

- - . , , , - . , , .

:

  • user_id
  • postmonth
  • readposts_array

, , . , .

+1

post_id ( , ). , , , , , .

, , , . , .

,

0

Source: https://habr.com/ru/post/1784379/


All Articles