Created on 30 March 2023, over 1 year ago
Updated 2 November 2023, about 1 year ago

First of all I would like to thank you for this module.
I have spent some time to test it on D9 and it works with no issues.

However, I am worried about the performance because all is written to the base table for example for content to :node_field_data.
Do you think it is good idea to have 90 columns in node_field_data instead of the default 13 from the permanence perspective?

Drupal 5/6 had this approach and it was changed in D7 to split it between the multiple tables. I know that now for the same we need at least 90*2 = 180 tables but they are faster due to split data. I know that joins them to get one table (due to reporting purpose) is pain in the ass and it has some costs in database but I am worried to use this approach to have so many columns. Which is advantage of course because no joins are needed or at least small amount, so this is + in term of performance, but for so many columns it could be problem, don't you think ?

Hence maybe another approach to create custom tables and add fields there as per need and split them based on content types like I do have 28 content types so would like to see 28 base tables with my fields and keep the node_field_data separated.
If i need to join them, just a few joins are needed.

What do you think?

PS: Cooperate with module Field Permissions would be helpful!

once again, thank you.

📌 Task
Status

Needs review

Version

1.0

Component

Miscellaneous

Created by

🇸🇰Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • 🇨🇳China qiutuo

    Hello, Drupal is excellent and has given us a variety of solutions. Programmers are required to design according to project requirements. The Easy entity base field module can work together with the Field module in the core without affecting each other. Programmers can choose which fields belong to The base table or use an independent field table. For projects with a small amount of data, the Easy entity base field may be a good solution.

    The original intention of the design is that my project needs a lot of data types. ECK has not been updated for a long time, so I designed a module that can easily create entity types. After creation, use Easy entity base field to add base fields, which solves unnecessary repetitive work.

  • 🇸🇰Slovakia coaston

    Hi,

    You wrotte:
    Programmers can choose which fields belong to The base table or use an independent field table.

    But how?
    TY

  • 🇨🇳China qiutuo

    My understanding is that classification design can be done according to the data type, for example, user entities: name, gender, age can be placed in the base table.

    For example, working experience: company name, business scope, entry time, position, departure time and many other fields, and there will definitely be multiple pieces of data, which requires the establishment of a new entity type, using entity references, Dynamic Entity Reference fields to achieve association, or It is a custom field to achieve.

    For small and medium-sized projects, the impact on performance is actually not too great. For applications with millions or tens of millions of data, more advanced performance optimization solutions are needed.

    Now popular micro-services can create multiple micro-application services based on application data types, and use APIs for data exchange, that the single-table approach is more clean and friendly.

  • 🇮🇹Italy giuse69

    I fully support the purpose of this module: when having a lot of fields, the core drupal approach without coding is to add one table per field and this has a significant impact on performances on large site (also making the DB not manageable with hundreds of tables), and using caching mechanisms is a workaround and need (a lot of) storage. To retrieve an entity, joining N tables is much slower than retrieving N columns from the same table in relational database, even if the N tables have indexes
    So the possibiity to add common fields as properties to the base table is very useful.
    Thanks to the maintainer :)

Production build 0.71.5 2024