Recently, a curious article for me appeared on Habré, after reading which a similar question arose. How adequate is the replacement of the standard EAV database architecture model with a database with JSON data and dynamically generated columns?

Personally, it seems to me that using JSON in the key, as described in the article, is more convenient for development and support, but by adequacy I mean optimization. I would like to know the opinion of experienced specialists in the databases and people who have already encountered such an architecture.

  • one
    And how does a model with JSON and dynamically generated columns differ from a simple table with such columns? for good or nothing. EAV is used when you need to add the ability to add columns without changing the application code. And at the same time provide a search for them. Adding, albeit virtual, columns to the table in any case leads to the need to specify these columns in the query. which automatically leads us to the usual flat table and the need to list all the columns in the query (which is often not bad, but where does the EAV then). - Mike
  • one
    If you already work with JSON, then imho is worth taking more adequate databases, like postgresql, where you can build a special index right on the json field and then work with it directly by json operators, rather than specifying some virtual columns - Mike

0