vendredi 27 février 2015

Chat-service database design


I have an android/desktop application that I'm now releasing on the web, and as there are some social aspects I thought of adding a chat-service so users can IM as well. For this chat service, I want people to have "Online, Offline, Busy and Away" as possible status.


I currently have a table in my database named "users", which has their username/password/mail etc, all the usual stuff. Now I was wondering whether I need to save the status of the user here as well?


If not: How do I best store a users status? (Keeping in mind others need to see this ofcourse)


If yes: What's the best way to go about this? I thought I would store it as an integer (e.g, 1==offline, 2==online, 3==away and 4==busy). Saving it as text would just be a waste of space?


(By the way, it's an RDBMS, if that matters :) )





Aucun commentaire:

Enregistrer un commentaire