Data modeling question: My application allows user...
# sql
l
Data modeling question: My application allows users to create webpages. I have a
pages
table but I'm not sure if I should create a
components
table with rows that have foreign keys from the
pages
table -- or use a
components
field set as an array type. I am concerned about the large number of rows modified as a user creates and modifies a page, and the high cardinality of this relationship.
b
Depending on how you need to query this data later, you might be better off just creating a JSONB field for the contents of the web pages.
It'll be a lot more performant that way, I think.
l
That was what I was starting to lean toward! Thanks @burggraf !