If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > data base structure for a instant messenger application

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-02-04, 13:06
invictus invictus is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
data base structure for a instant messenger application

Hello guys.

I am working on a simple instant messenger application similar to yahoo but not as complicated as yahoo messenger. I am not a fine database designer. I am basically a newbie in these database stuffs. I have uploaded my database structure about how i am going to implement the system.

Please guide me in finding the faults, drawbacks of the structure.

what might be the drawbacks, what might be the problems, is this thing correct ?

http://subrat.skcventure.com/db/my_er_diag.jpg


please note that here,

offline msgs are offline msgs like in yahoo messenger

memos are something like private message thing in this forum.

Thanks

Invictus
Reply With Quote
  #2 (permalink)  
Old 01-02-04, 13:44
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
It appears at first pass to be pretty good.

I don't understand the Buddy_List table.
__________________
visit: relationary
Reply With Quote
  #3 (permalink)  
Old 01-02-04, 18:13
invictus invictus is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
hi,

eerrm

both user_id and buddy_id are primay keys because both can represent each other coz both are users

about the buddy list thing,

i plan to stor my buddies like this:

lets say my user id is 100 and i store it

user_id buddy_id
100 234
100 211
100 932
234 100
211 100
932 100
234 512
512 234


but one thing is that if "x" has "y" in his buddy list, it doent mean that "y" will always have "x" in his buddy list because "x" might have been annoying to "y" and "y" deleted him

i plan to get the buddy list of a user ip by
select buddy_id from buddy_list where user_id=100

to find buddy of
select user_id from buddy_list where buddy_id=100


i think i have told u the whole senario.

please tell me if this is a proper way to do it or not.

if it is, is the structure for the buddy_list table seem to be okay ? :s

Thanks

Invictus
Reply With Quote
  #4 (permalink)  
Old 01-03-04, 10:31
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
Okay, makes sense.

The notation you are using is a little different than those I am familiar with, but I think buddy list should have two relationships to users. One for buddy_list.user_id and one for the aliased user, buddy_list.buddy_id.

buddy_id is actually a foreign key.

Next, explain how Restricted works.
__________________
visit: relationary

Last edited by certus; 01-03-04 at 10:33.
Reply With Quote
  #5 (permalink)  
Old 01-03-04, 10:49
invictus invictus is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
hi.

well i also think the restricted thing is kinda baseless there.

what i am wanting to do is that "restricted" table just contains a list of user_id OR ip_addresses that are forbidden to use the system.

I also dont think that should be linked like because it is just a list.

when the admin wants to ban a user or an ip address he just updates or insert a record in the "restricted" column.

he can either put a user_id OR ip_address OR both in the "restricted"
table.

Is there anyway i can express that in the diagram ? (i think the way i am doing it there is completly baseless. please guide me if i can actually show it in the diagram or is it that i dont have to show it and leave it as just a 3rd table that isnt in the diagram ?)


Thanks

Subrat
Reply With Quote
  #6 (permalink)  
Old 01-03-04, 11:34
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
Would a boolean IsRestricted flag in the user table be adequate on one side? On the ip_address side perhaps a list of restricted ip addresses that are programmatically looked up would be adequate.

What's the difference between a contact and a buddy?
__________________
visit: relationary

Last edited by certus; 01-03-04 at 11:37.
Reply With Quote
  #7 (permalink)  
Old 01-03-04, 11:46
invictus invictus is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
thnks for the reply.

i think the IsRestricted should be okay as well. i get what you are trying to tell me. thanks. that should be a good idea.

buddies are friends like they have friends in msn messenger.

contacts are the entries of the address book. contact category is something like in yahoo mail they have categories in address book such as friends and families.

contacts and buddies are different stuffs.

should contacts and contact_category be many-to-many ?

example:

A has B in his "friend" contact category

C can also have B in his "colleague" category

and A and C might have many categories.

so many categories should have many contacts right ?:s

Thnks
Reply With Quote
  #8 (permalink)  
Old 01-03-04, 16:42
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
Yes, a many to many between contacts and categories does seem to make sense. Use an associative relationship.

Categories(CategoryID, attributes)
Contacts(ContactID, attributes)

CategoryContact(CategoryID,ContactID)
__________________
visit: relationary

Last edited by certus; 01-03-04 at 16:45.
Reply With Quote
  #9 (permalink)  
Old 01-04-04, 00:21
invictus invictus is offline
Registered User
 
Join Date: Jan 2004
Posts: 8
yeah i have done exactly that in my mapping.

thanks a lot man

Invictus
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On