Answer the question
In order to leave comments, you need to log in
Is it ok to store json in database?
There is a document, it has blocks of different types (header, table, list), the block has a hierarchical recursive relationship. The block has styles (font size, color)
Each block type can have additional fields (the table has headers and rows)
Is it more expedient to store metadata and styles as json or create separate entities for this, or use entity inheritance?
Answer the question
In order to leave comments, you need to log in
https://www.postgresql.org/docs/9.5/functions-json.html
json gives ambiguity that you, as a developer, will have to manually check in your code
Will you need to get data from within json directly from the DB? If not, then it's a perfectly normal solution. Even if it is necessary and the database supports json, then it is possible, unless, of course, you do a selection on these entities.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question