What is the best relational database schema used to implement a flexible dynamic data warehouse?

I am creating a CMS (yes, yes, I know, but I like it, okay? :-)), which has "records". These records have a fixed number of standard fields that can be written in db-id, header, date, etc. All standard materials.

However, I also want the records to have X number of user fields associated with them. These custom fields will be user-defined and may have names, descriptions, formatting, maximum length, and other attributes. Now, obviously, I can easily store the definitions of these fields in the db table, but what is the best way to store and map data for each record that matches these custom fields?

ExpressionEngine does basically the same thing, and uses a table of records to which columns for each custom field are dynamically added. But I can’t believe that this is the best way to solve this problem.

Are there any more efficient ways to structure relational db to solve this flexible data model?

+4
source share
1 answer

This is basically EAV (lite):

http://en.wikipedia.org/wiki/Entity-attribute-value_model

I asked literally the same question (regarding a similar topic):

Flexible forms and database structure support

+3
source

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


All Articles