title: Firestore data duplication
body: <p>I'm trying to setup a friend system in Firestore. My data model looks like this at the moment:</p>
  
  <pre><code>collection("users") -&gt; 
    document("user1")
    document("user2")
    ...
  </code></pre>
  
  <p>A document in the <code>users</code> collection contains data like the <code>name</code>, <code>email</code>... of the user. I'd like to enable a user to have friends now, but I'm unsure about the best way to model this.<br>
  So, I'd for sure add a <code>friends</code> field in the documents of the users, but what should this field contain? My first thought was a pointer to a new collection called friends in which the documents are users. Something like this:</p>
  
  <pre><code>collection("users") { 
    document("user1") {
      name:user1,
      friends: -&gt; collection("friends") {
        document("user2"),
        ...
      }
    }
  }
  </code></pre>
  
  <p>This seems reasonable, but that'd mean that I'd have a lot of duplicate data in my database because each user that has friends will be duplicated in a <code>friends</code> collection. Should I worry about this or is this normal in a Firestore database structure?<br>
  Would it perhaps be possible to point to a document in the <code>users</code> collection from the <code>friends</code> collection? Something like:</p>
  
  <pre><code>collection("users") { 
    document("user1") {
      name:user1,
      friends: -&gt; collection("friends") {
        document, -----
        ...            |
      }                |
    },                 |
    document("user2")&lt;-
  }
  </code></pre>
  
  <p>Or should I throw away the thought of using a collection for friends and just keep a list with uids of all friends of the user?</p>