DEV Community

Darcy
Darcy

Posted on

DB best practice question

I am building an app on Strapi and am deciding on the best practice to organise the database.

I have a Table (‘Job’) that has roughly 60 rich text form fields. Additionally, each of the form fields needs to have a ‘visibility’ boolean value, which toggles whether the field is viewable by certain users.

Regarding the database structure, do you think it is better practice to have two separate fields, or to combine them into a single JSON field that contains 'value' and 'visibility' as keys within the field?

The upside of having them separate is that can store them text and boolean, but the downside is that it will double the number of fields needed for each Table.

Top comments (0)