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 > Database Server Software > DB2 > Database design for social networking website

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-11, 12:34
pargat89 pargat89 is offline
Registered User
 
Join Date: Feb 2011
Posts: 1
Database design for social networking website

Hi,

I am designing a social networking website in JSP for my project. The website working is somewhat similar to orkut. One user can send messages to another user. I have 2 different ideas to save the messages in database.

First, i can create a table named messages in database with columns -sender_id, receiver_id, message, time. It will store message form a particular user to his friend. But in this structure records in table will increase at a very faster rate. e.g. for 100 users having 100 scraps each there will be (100X100=)10000 records in the table, making the table quiet heavy very soon.

Second logic is to create a dedicated table (userid_messages) for every registered user to store his messages. In this logic no of tables in database will increase as the no of users increase.

I am using JSP with IBM DB2 database. Please suggest me which of these 2 is the better way to handle user messages. Please tell me if you have any other better way also.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 02-22-11, 17:40
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Without being able to see your complete requirements, it is extremely unlikely that having a dedicated table for each user to store their own messages is the best way to go. DB2 tables can easily have billions of rows, but you are not going to want to deal with a very large number of tables.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Tags
database, design, networking, social, website

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