Add-ons or Joins vertically on a table?

Options

Hi, I have 2 tables that have almost all of the same columns. One is of official data, the other is of 'proposed' data. These tables for the most part are displayed separately in my app on my front end.


Some of the rows in my 'proposed data' will be 'promoted' to be displayed in the 'official data'. I am trying to figure out what's the best solution to perform this and am considering the following options. I don't know if some are even possible. Any advice would be helpful.


1) In the GET API to the official table, I use some sort of Vertical Join to query the proposed table of the rows that I want to return as well. I can't find any documentation on a vertical join of any kind.

2) A background task that checks the proposed table if it should be promoted and create a record in the official table. This seems like it could get messy with potential for duplicate data.

3) Combine both tables into 1 and just add identifier columns to differentiate between proposed and official. I'm worried if this would make my front-end slow once my proposed data gets unnecessarily long.


Any advice on any of these solutions would be helpful. Thanks in advance.

Answers

  • nocodetalks
    nocodetalks Member ✭✭
    Options

    I think a much better solution is option 2.

    You have to merge your data only one time. For duplicates, you can add constraints in a much better way so no duplicate data will be added.


    You can even use the "customized response" while sending data to frontend so that you will send data that is required.