View Full Version : Question about status updates

12-20-2010, 10:40 PM
Ok so I'm going to try something like a wall but it's not a wall.
It's a chat box that also adds certain activities to it as well.
So peoples chat will come up and some times "so and so has done this"

My question is what would be the best way to store this data?
If I do it in one table it'll get quite bulky but I could do a cron every few hours that deletes chat entries older than said datetime

Or would it be better to have 2 seperate tables one for chat one for activity?
Then I'd have to do a bit more coding but would this way be more efficient?

Any thoughts on this would be most appreciated



12-21-2010, 03:08 AM
If you are intending to do things like delete and search, a database will make life a lot easier.
How many tables you use depends on how much needs to be normalized. If many 'chats' include many 'activities', you need to use 3 tables in a relational database as you cannot represent many to many relationships between two tables. This appears to require 2 tables as many 'activity' is associated with one 'chat'.
You don't really have a lot of information to work with here, so I don't think I can really suggest much else.

12-21-2010, 07:25 PM
Well heres what I am trying to achieve overall.

There is a chatbox on the page which is updated with jquery
in the chatbox there is a field where you can type and send a message that then appears in the the chatbox
but if someone makes a request for a song (its for my internet radio) then also post in the chat (so and so requested this song)
then if someone "likes" the request (so and so like whoevers request for artist - song)
same goes with comments,friends etc

then at some point (just a thought not definitely) have the activity on peoples profile, in which case i wont want the chat messages by said user id just other activity

hope this is more of an insight