title: Products and variants - best way to design database
body: <p><strong>Description</strong></p>
  
  <p>Shop can have products (Shoes, T-Shirts, etc). Each product can have many variants where each can have different price and stock, e.g. T-Shirt has different colors and sizes</p>
  
  <ul>
  <li>Color: Blue, Size: L, Price: $10, In stock: 5</li>
  <li>Color: Blue, Size: XL, Price: $10, In stock: 10</li>
  <li>Color: White, Size: L, Price: $10, In stock: 6</li>
  </ul>
  
  <p>My solution for this problem is depicted in the picture</p>
  
  <p><a href="http://dl.dropbox.com/u/43925242/erd_product_variant.png" rel="nofollow">http://dl.dropbox.com/u/43925242/erd_product_variant.png</a></p>
  
  <p>But this solution has some disadvantages</p>
  
  <ul>
  <li>it's hard to control each variant of same product should have same number of variant_features,</li>
  <li>searching products through variants features can take some time,</li>
  <li>any other about i have no idea...?</li>
  </ul>
  
  <p>What can you suggest to simplify design of database for this problem?</p>
  
  <p>===== UPDATE ======</p>
  
  <p>And what about NoSQL solution? Any proposals?</p>