title: Database design suggestions for a configurable product eshop
body: <p>I am building an e-shop that will have configurable products. The configurable parts will need to have different prices and stocks from the main product.
  What database design would be best in this case?</p>
  
  <p>I started with something like this.</p>
  
  <p><strong>Features</strong></p>
  
  <ul>
  <li>id</li>
  <li>name</li>
  </ul>
  
  <p><strong>Features Options</strong></p>
  
  <ul>
  <li>id</li>
  <li>id_feature</li>
  <li>value</li>
  </ul>
  
  <p><strong>Products</strong></p>
  
  <ul>
  <li>id</li>
  <li>name</li>
  <li>price</li>
  </ul>
  
  <p><strong>Products Features</strong></p>
  
  <ul>
  <li>id</li>
  <li>id_product</li>
  <li>id_feature</li>
  <li>value ( save the value from the feature-options for ease in search )</li>
  <li>configurable (yes, no)</li>
  </ul>
  
  <p>The problem is that now I am stuck on how to save the configurable product features.
  I was thinking of saving their value as a json. But that will make saving price modification for a certain option difficult.</p>
  
  <p>How would you go about this ?</p>
  
  <p>Thank you.</p>