Unread forum implementation

Implementation of the asp.net mvc3 forum. Part of the implementation is a function that shows which messages were read and which did not.

Now I implemented this in that I create an entry in my data for each user when creating a new message, and then delete them while they are displayed to my users, I also delete everything for items older than 1 month.

I currently have 450 users, so it takes a long time to create them.

I thought there should be a better way, since large vbullitin or phpbb forums with over 1000 users can do this without spending 2+ sek on post-creation to create all these posts, but I did not find it. I see some other questions about this on this site, but I did not find an answer that I can use.

+4
source share
3 answers

You need to record the last user activity, but saving everything in the database will not be effective. Because of this, you will also need to set cookies to find out which streams they are viewing. A bit of a hybrid approach, but there are a few discussions here:

+2
source

One way to store less data and speed up work: for each stream the user reads, create a database record to record the timestamp when they last looked at that stream. Thus, each user does not receive a record for each message - only for streams ... and only for streams that they really read.

You can easily determine what is unread inside the stream ... if you do not have a timestamp in the database for this user / stream, then this is all unread for them. If you have a timestamp, all messages in the stream after this timestamp are unread.

0
source

Maybe each user should stick to the identifiers of the messages being viewed, and not those that they did not view? It will be significantly less expensive at the time of creation.

-1
source

All Articles