I am designing some schema in my Postgres 12. And I have an entity (lets call it “Laptop”) with an attribute (lets call it “Properties”) like:
{ <someKey>: { <someLabel>: <someValue> } }
For example, the laptop has these properties:
{ "cpu": { "count": 8, "model": "Core i7" },
"disk": { "size": 123456789, "model": "Samsung", "speed": 7200 },
...
}
And now I have to choose how to implement it: as tables or just as a JSON/JSONB column in the table “laptops”. What are the criteria / principles when to use JSON/JSONB columns or to design such attributes as tables?