title: What's the best practice for when it comes to storing an array of simple dictionary entries into a relational database?
body: <p>Here's a simplified version of the data that I'm working with</p>
  
  <pre><code>{
      "name": "Sinistrofu Cloak",
      "itemType": "Cloak",
      "level": "200",
      "stats": [
        {
          "stat": "Vitality",
          "minStat": 251,
          "maxStat": 300
        },
        {
          "stat": "Strength",
          "minStat": 71,
          "maxStat": 100
        },
        {
          "stat": "Wisdom",
          "minStat": 16,
          "maxStat": 25
        }
  }
  </code></pre>
  
  <p>And here's my simplified model:</p>
  
  <pre><code>class ModelItem(Base):
      __tablename__ = 'item'
  
      id = Column('id', UUID(as_uuid=True), unique=True, nullable=False, primary_key=True)
      name = Column('name', String, nullable=False)
      item_type = Column('item_type', String, nullable=False)
      level = Column('level', Integer, nullable=False)
      stats = Column('stats', JSON)
  </code></pre>
  
  <p>Most of the fields and how they translate into my database are pretty self evident. I'm really just curious about how I should go about structuring the <code>stats</code> column. Would it be better to store it as is in JSON format or would it be more proper to create a new <code>stat</code> model and create a new table for it that links back to the <code>item</code> model with a foreign key? </p>
  
  <p>To me, it seems a bit unnecessary to do the latter but, as a novice, there may be benefits to it that I don't yet understand</p>