title: Database design: Send the ID or the Value in a relationship
body: <p>this is a design question.</p>
  <p>Imagine this, I have two tables.</p>
  <pre><code>|user|
  ------
  |id|
  |username|
  |team_id|
  
  |team|
  ------
  |id|
  |name|
  </code></pre>
  <p>So when receiving a <code>POST /users</code></p>
  <p>Should I send</p>
  <pre><code>{
     &quot;username&quot;: &quot;newUser&quot;,
     &quot;name&quot;: &quot;myTeam&quot; /
  }
  </code></pre>
  <p>Get the team id first or includes if using ORMs</p>
  <p>or</p>
  <pre><code>{
     &quot;username&quot;: &quot;newUser&quot;,
     &quot;team_id&quot;: 1 // references the &quot;myTeam&quot;
  }
  </code></pre>
  <p>Insert it directly and if the team_id doesn't exists fail</p>
  <p>Which one is the best and why?</p>
  <p>This is just an example with only one relationship and it could happen that the user table has a lot of relationships</p>