On Tue, Jan 20, 2009 at 5:25 PM, Miles J <[email protected]> wrote:
>
> @Brian - Its just a lot of overhead. Ive spoken to many PHP gurus and
> they said storing it in the DB is not the best way. I even looked at
> PHPbb and they didnt do it that way, unless im completely blind.

Everything comes at a price. If you want to know which
threads/comments a user has seen, that has to be stored somewhere. If
you want to avoid that, you don't display any difference between read
& unread threads or comments.

I've no idea how PHPbb does it but I hope it's not setting a cookie
with all read thread IDs. That's the only other way I can imagine that
info being preserved.

> Anyways the process would be something like:
> - User logs in
> - Get last session of unread threads from the db
> - New query to get new threads/posts since last visit
> - Merge the 2 previous
> - Store new data in the session
> - If a user reads a thread, delete in the index from the session

Maybe we're not talking about the same thing. I've don't see how what
you're suggesting would be different from what I've already posted. If
you're grabbing the info from the DB, then which table?

Maybe what you mean by "unread" is threads/comments that have been
posted since the user's last visit (time grabbed from a cookie). But
that wouldn't be at all accurate. A user can log in but not read
certain threads. Those should remain in an "unread" state the next
time the user logs in.

Keep in mind that a decent DB engine can easily handle (many) millions
of records. And, I suppose, the table you use to store the keys for
"read" threads/comments can be flushed of very old rows to further cut
down on seek time.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to