Better design to display parent child record data

Certified Senior Developer

Need help to design & create records for below requirement,

  1. Each day 1 parent file and 8 child files will be loaded into DB table. Each child file will be having separate columns except foreign keys. Consider fileReferenceId and dataId are foreign keys.
  2. I have to display parent file data on landing page and provide link on dataId.
  3. Once user clicked on any of the data Id, user will be redirected to new page where records from child table needs to be fetched & displayed using dataId and fileReferenceId.

My Approach: 

  • Create entity backed record using parent table. Whenever user click on dataId  , using 'fileReferenceId ' decide which child table needs to be called from 8 tables. Using 'fileReferenceId and DataId' display returned data on interface.

Could you please suggest another approach to avoid so many DB calls. Is it possible to create separate record for each child table and link in the parent record.

Thanks,

Hemant.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Not sure you can avoid the multiple DB calls unfortunately unless you can guarantee that the number of rows for each of the related record is under 10 for a single parent record. In order for this to work, you also need to ensure that the total amount of rows in the child tables will be under 2M. That's if you gp the Record Type route.

    The only other way is to do nested data types, just need to be careful when querying the 1-n nested CDT fields that you're retrieving them for a single entity and not a list of parents.