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.