Welcome Guest, Not a member yet? Register   Sign In
Building a Read vs Unread Status for a Forum
#14

[eluser]jedd[/eluser]
[quote author="andrewtheandroid" date="1257521730"]
I see how a busy forum with many new topics each minute would be a big problem but then again I set the arbitrary number because I think we need to set a line so it won't cause a problem for performance?
[/quote]

The idea of an arbitrary limit came up in that earlier thread I pointed you at. I pondered it for a while, but I decided against it.

While you might save some space, you end up having to do more code (exception handling, count checks) and I suspect performance actually degrades.


Quote:Also if there were 100 new topics that were 5 pages deep I think anything past 2 pages is not as 'new' it is true I haven't read them but then if i dont visit the forum in one month I don't want to be flooded with 100 new topics as unread.

All true - however any thread (or topic, if you prefer that word) you haven't visited is marked as unvisited - there's no record of your state within that thread. To really spell this out - it means you don't store any data for that user / thread combination. You can deduce programmatically - from this absence - that the thread is unread (and, of course, that the user has never visited the thread).

Anything beyond 2 pages is, again, an arbitrary limit you're placing on every user for every situation - at best it's going to inconvenience a handful of people, at worst it's cheating. Wink And, as I say, I don't see significant benefits from saying 'okay, more than 2 pages of new messages, I'm going to stop tracking this page for this user, but for that user, who was here yesterday, I'll keep tracking it for them .. until another five messages come in .. yada yada.

Quote:I only did a database unit in uni so I have no real experience when it comes to real world performance of something like that. I'm genuinely interested to know what kind of problems that would cause. Would it be a performance issue? or a maintenance issue? etc..

You can easily do the math, if you want.

You need to know the number of active(!) forum users, the number of new threads popping up a day, how long threads may remain open without activity - this will give you worse case (size-wise) figures. Obviously not every user hits every thread across every forum, so the real-world results will be better (small data set, better performance).

In your case - 400 users multiplied by whatever number of threads you're expecting to start each day, multiplied by the number of days threads are active before being automatically locked .. will give you a rough table size. My gut feel is that the result could be termed 'trivial', both in terms of space and subsequently data access times.


I think there's a few other factors to consider - you've hinted at one (the 'older than two pages' thing), which is the presentation aspect. The way the CI forums do it .. well, I haven't quite worked it out. They seem to cheat a bit, and occasionally I lose state of my threads in the two forums I regularly haunt. Any system I write would have to be far more consistent.

A corollary is your question about whether this feature is necessary or just nice - I think it's necessary, as reading forums without some way of being able to identify which threads contain new messages would just be a nightmare. I really like the way that these forums work - emboldify the subject text, and provide a link to the newest message in the thread.

There's also whether you're going to auto-lock your old forums - if you do, then you have a) reduced the size of threads you need to track, and b) an ideal hook location for auto-cleaning dead thread/user/post table entries.


Messages In This Thread
Building a Read vs Unread Status for a Forum - by El Forum - 11-04-2009, 10:21 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-04-2009, 10:39 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 12:15 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 08:23 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 09:45 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 09:58 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 10:11 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 11:51 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 01:06 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 06:52 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 07:39 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:35 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:40 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 07:14 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:12 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:17 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:24 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:31 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 11:29 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 12:50 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:04 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 04:22 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB