FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help for Instant Messenger





ashok
Hi, i'm in need of devleoping a instant messaging solution, both the server and the client. I'm in search of a database design which will be optimal.

Basically i'm not able to decide how to maintain the contact lists of each & every user... how that table should be designed?
Antoine_935
I have some idea, but it has to be bettered

Code:
Table USERS:
int(ID), varchar(name), varchar(password) (crypted, of course)

Table CONTACTS
longerInt(ID), int(userID) (contact belongs to this user), int(contactedID) (ID of contact)


well, a little bit difficult to explain
but I'll give an example:
My login is "lambda"
I have a friend. his login is "crypton". he's in my contacts list

Code:
table USERS:
1, lambda, osfmllsdf
2, crypton, lfklsjkzen

table CONTACTS:
1, 1, 2
// this means lambda will have crypton in his contacts list, because 1 is lambda's ID and 2 is crypton's ID


Maybe it isn't the best way to store it, but this is already some idea to get it working
Yoou also may put user's password in another table (eg: UserInfo), you'll get faster contacts listing but longer login
ashok
thanks for the quick reply and the tip antoine... just like you've said about optimality, since each client will have lot of contacts, redundancy will occur and the table size will increase too much... any optimization idea??
ashok
@Antonie I've just checked out the table design of wordpress. It's using the same method you described for maintaining it's categories.

It's maintaining a separate table for categories, posts, and category lists. The category lists table contains the post id, and the category id. Multiple times same post id can be observed meaning same post belonging to different categories. Almost similar to my requirement, a person belonging to different user's lists and a user having different contacts in his list.

Seems like this is the design being used a lot... I'm also going with it. thanks a lot for your help antonie
Related topics
Instant messaging
What messenger/email service do you use
Help with downloadcounter, earn 50 frih$
Where are public chat rooms for AOL Messenger?
Long distance relationship
mail command of Unix
[Request] Banner (and forum graphics) creation & design
Need this script...
Learn Portuguese
WinSit.exe being called everytime XP starts
Date Wealthy Women Men
Thinking of setting up a new Business, need advice
I Google®-d and Photoshop®ped
Pidgin Instant Messenger
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.