title: How to store objects in a relational database?
body: <p>Someone asked a similar question before, but it wasn't answered. <a href="https://stackoverflow.com/questions/15650898/how-to-store-value-objects-in-a-relational-database">How to store value objects in a relational database?</a></p>
  
  <p>Here is an example situation where my question comes into play. Let's say there is a 'users' table, and each user needs to have their location stored. Their location is essentially just 3 coordinates: x, y, z.</p>
  
  <p>But, I'm not sure how I should be going about this. I could just add 3 integer fields to the 'user' row named 'x, y, z'.</p>
  
  <p>Or, I could add a 'location' String field to the user row, and then simply serialize and deserialize whenever I fetch/save a user's location.</p>
  
  <p>Or, I could create a 'locations' table, that has an auto-inc primary key id, that will be used as foreign key for the 'users' location database, which would have 4 fields: 'id', 'x', 'y', 'z'.</p>
  
  <p>So, which one is best? Maybe there's an answer I'm not seeing that's better? Thanks.</p>