Scenario:
We have "employees_final" ADLA catalog/table.
Users from various locations would be loading employees data into "employees_final" ADLA catalog/table "in parallel" through ADF invoking U-SQL.
When users are loading the data, it goes to staging table (employees_staging) first. If there is an update to existing record, then we will have two versions of data stored in staging table (employees_staging). Next step is, we need to have "employees_final" table with latest version of record ONLY.
To create final table, we are JOINING staging and final tables to find the insert/update employees and combining the existing records with new records and RECREATE final table.
NOTE: As there is no DELETE option, we are caching the existing records and appending new/update records.
The drawback of this approach is, when users are running ADF in parallel, it will try to update SAME employees_final table and there is a chance of DATA LOSS due to TRUNCATE/RECREATE table approach.
Do we have any better way to handle PARALLEL scenario?