Results 1 to 14 of 14
Jan 28, 2011, 14:37 #1
- Join Date
- Jul 2010
- 0 Post(s)
- 0 Thread(s)
Mark objects as NEW in MYSQL based application
I am making a web-based application written in PHP and MYSQL (My first full app, hooray!).
I won't go into details much, but here is a dilemma I have:
The application will have events, and users who didn't read the event content yet should see the event as "NEW".
Now, the question is how to implement it.
I have a users and Events tables in my database.
Adding all the IDs of user who did see the event to the Events DB seems a bad idea, the DB will grow very quickly.
Reversing the process and deleting IDs of users who saw the event seems better, but the Event row in the DB increases size and that impacts.
So I thought of adding each "NEW" Event ID to every user who didn't see it. Seems more logical to me. When the event is no longer "NEW" to the user, the Event ID gets deleted. That way the load is distributed among the users.
Plus I can clear "NEW" events once in a while.
If you have a better way of implementing it (a "CONNECTION" object perhaps), please advise.
The post was written quickly, excuse the bad explanation.
Thanks in advance.