Comment on When to Avoid JSONB in a PostgreSQL SchemaparentComments−strommen10yEAV is an anti-pattern?If you don't have JSONB, EAV is the only remotely-reasonable way to implement user-defined fields (e.g. product-specific attributes in e-commerce).−malisper10yIf you want to allow user-defined fields in a relational database, your realistic are either EAV or stuff json into a text column. EAV, if done extremely carefully, can be a good solution, but 99% of the time, it's going to be a huge pain.−approachingtraj10ystuff json into a text columnYou did see the article was about JSONB, which is significantly more sophisticated than "json in a text column", yes?−malisper10yYes, the person I was replying to was asking about what to do if you don't have jsonb.
Comments
EAV is an anti-pattern?
If you don't have JSONB, EAV is the only remotely-reasonable way to implement user-defined fields (e.g. product-specific attributes in e-commerce).
If you want to allow user-defined fields in a relational database, your realistic are either EAV or stuff json into a text column. EAV, if done extremely carefully, can be a good solution, but 99% of the time, it's going to be a huge pain.
You did see the article was about JSONB, which is significantly more sophisticated than "json in a text column", yes?
Yes, the person I was replying to was asking about what to do if you don't have jsonb.