title: Followers/following database structure
body: <p>My website has a followers/following system (like Twitter's). My dilemma is creating the database structure to handle who's following who.</p>
  
  <p>What I came up with was creating a table like this:</p>
  
  <pre><code> id  |  user_id  |  followers |  following
    1  |    20     |  23,58,84  |  11,156,27
    2  |    21     |  72,35,14  |  6,98,44,12
   ... |   ...     |    ...     |     ...
  </code></pre>
  
  <p>Basically, I was thinking that each user would have a row with columns for their followers and the users they're following. The followers and people they're following would have their user id's separated by commas.</p>
  
  <p>Is this an effective way of handling it? If not, what's the best alternative?</p>