When to use JSONB type for such a column? I am designing some schema in my Postgres 12. And I have an entity (lets call it &quot;Laptop&quot;) with an attribute (lets call it &quot;Properties&quot;) like:
{ &lt;someKey&gt;: { &lt;someLabel&gt;: &lt;someValue&gt; } }

For example, the laptop has these properties:
{ &quot;cpu&quot;: { &quot;count&quot;: 8, &quot;model&quot;: &quot;Core i7&quot; },
  &quot;disk&quot;: { &quot;size&quot;: 123456789, &quot;model&quot;: &quot;Samsung&quot;, &quot;speed&quot;: 7200 },
  ...
}

And each laptop has own set of properties...
And now I have to choose how to implement it: as tables or just as a JSON/JSONB column in the table &quot;laptops&quot;. What are the criteria / principles when to use JSON/JSONB columns or to design such attributes as tables?
The rule of thumb is: if the data are just payload to the database and will never be used in WHERE conditions and the like, use json. Else, use jsonb.