title: How instagram and similar sites, manages to show Profile picture for every comments in a post?
body: <p>I am using <strong>nodejs and mongodb (mongoose)</strong> to create a <strong>social media like site</strong> where users can comment on a post. I want to show the profile picture and the username of the user who has made a particular comment. Comments for posts are stored in a collection and the schema is as follows: </p>
  
  <pre><code>{
      commentMessage: String,
      senderUserName: String, 
      senderPictureLink: String, 
      timestamp: Number, 
  }
  </code></pre>
  
  <p>But I realized that this approach leads to lot of <strong>duplication of profile picture link</strong>. <br>
  Querying the <strong>useraccounts collection for the profile picture link</strong> of the users who commented on the post will lead to lot of find() queries. <br>
  So I need to know how the big social networking sites are doing this.</p>