sql - Database design decisions -


i trying create efficient , scalable data model application writing. coming common problem far design goes, example listed below exemplifies problem well:

i want create table of users each primary key id field, , facebook, have friends users. better have field in users table called "friends list" lists of ids of users friends, or have table each user listing friends, or maybe other option have not though of yet?

i need have efficient way pull users friends information, such names addresses, etc. fear have string of ids must iterate through , join on users table, might not terribly efficient if have partitioned database. specific situation, see generalization of problem elsewhere in application.

any appreciated. thank you!

you make friends tables. table have 2 fields user_id , friend_id(also user_id) below basic image of design.

enter image description here


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -