What's the most efficient way to remember read/unread status across multiple items?

For example, let's take the format of a forum, where we have multiple users and multiple threads. Say this forum wants to track which users have read which threads and, say, use that information to mark which threads are unread when viewing the thread list.

The only solution I can imagine is something that drops a record into the database each time a user visits a thread. I suppose there could be a 'mark all as read' button, which could employ a time stamp to help lessen the sprawl in the database... regardless this isn't a solution that impresses me.

I have a feeling that I'm missing something here... maybe Thanksgiving morning isn't the time to think over one's programming problems.

Is there a better solution out there for this? Any ideas?

Answers


  1. Drop a record in the database for each user-thread combination
  2. Or store this information in a file - one file per user. It may need to be locked/unlocked in case multiple logins by the same user are allowed.

Using a database record sounds like the most promising to me. It will generate a table with millions of rows very quickly if you have an active forum but it would be the simplest solution to implement. It will give a lot of flexibility for querying which users are reading what too.


Need Your Help

How to make java use millimeters instead of pixels?

java printing size lwjgl image-resizing

My problem is that what I size a picture according to millimeters to pixels, and then print it out this will never be exact.

How to map JSON to Java Object

java json

In my web-service, I'm sending a json inside the post request to server. In server I need to put this information into Argument of my called function.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.