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.
What is the best datatype to store a list of numbers
I would like to store a list of integers in a row.
Each row represents a user.
The list can grow and shrink, but it has to be attached to a particular user.
What is the best data type for a list of numbers?