title: What is a good idea to save "Chat" data in database?
body: <p>I am working on a Chat website. I am using asp.net and SQL Server 2008</p>
  
  <p>The idea will be same like normal chatting websites. My problem is, I do not understand how to create a good database design.</p>
  
  <p>I have good knowledge of vb asp.net with SQL Server.</p>
  
  <p>In my project, I created a table for adding new user with <code>ID, uName, uPassoword</code> and <code>uDetail</code> columns.</p>
  
  <p>Then.... I created a table named <code>User_Friends (uName , uFriendName)</code>. </p>
  
  <p>Suppose when user "abc" add new friend it save the relation uName = "abc" and uFriendName ="xyz" in this table, same all other users will do to add there friends and all that data will go in one table (<code>User_Friends</code>). All detail that who is whose friend information is in this <code>User_Friends</code> table. </p>
  
  <p>My question is:</p>
  
  <ul>
  <li>But what if there are 10000 users or more and each user add many friends as friend in DB.   </li>
  <li>Same thing if I want to save each user chat in DB. Should I use one table for all users chat history or something else.</li>
  </ul>
  
  <p>Then WILL IT BE A SLOW PROCESS TO GET DETAIL FROM ONE TABLE OR NOT?</p>
  
  <p>Please advice me how to design DB or give me some useful links for help.</p>