How to reverse engineer an EAV table

Most of our tables in our MySql db are not EAV tables . I read SQL Antipatterns and am trying to determine the best way to redo this table. I know that we will enjoy the benefits of simpler links in our spring forms and better data integrity.

The table in the EAV table has optional attributes that may have an expense. There are 55 options in the code right now, and that number continues to grow. The average number of attributes per expense is 2.719, and the highest expense is 39 attributes.

Would creating a table with 55+ options be ideal in this situation, or would the next person who should maintain this table edible?

+4
source share
1 answer

This seems to be a good time to peek into the document-oriented repository as an alternative (not SQL) project, where EAV triples can be stored, for example, JSON in MongoDB . You do not define a schema for this, so the query syntax is different from SQL, but in some cases it can be much stronger. For example, I recently saw a presentation on how to use this setting to create related data using RDF, which then formed a general level of reinforcement of the whole load of other services, such as REST, webservices, XMLRPC, etc. It is much easier to do this with the data standardized, apparently.

See this question to find out more about whether this would be a good idea.

+3
source

Source: https://habr.com/ru/post/1402655/


All Articles