title: Database design: flexibility vs. simplicity
body: <p>I am trying to weigh up the relative pros and cons of a simple database structure such as this:</p>
  
  <p><b>1.</b></p>
  
  <pre><code>CREATE TABLE x (
      my_id INT PRIMARY KEY,
      ...,
      text_attribute_blah TEXT,
      text_attribute_blah_blah TEXT
  );
  </code></pre>
  
  <p><em>vs:</em></p>
  
  <p><b>2.</b></p>
  
  <pre><code>CREATE TABLE x (
      my_id INT PRIMARY KEY,
      ...
  )
  
  CREATE TABLE attributes (
      my_id INT,  /* foreign key to x.my_id */
      text_attribute_type INT,
      text_attribute TEXT
  )
  </code></pre>
  
  <p>Where attribute_type could be blah or blah_blah.</p>
  
  <p>Option 1 offers simplicity - the table is easier to read/write; Option 2 offers flexibility (if we want to add another attribute such as blah_blah_blah, we don't need to make schema changes and so probably fewer code changes.)</p>
  
  <p>Is there a right/wrong answer to this conundrum?  Is one of these options considered better practice than the others?  Can you point me at further reading that might help be determine the way forward?</p>