Medallion architecture, how to update Gold tables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 04:30 AM
Assume that I have a data source that is ingested to a few bronze tables, and transformed to a silver table. Ans next, a gold table is created by aggregating the silver table.
If new records arrive in the data source, bronze and silver tables are updated by appending new records. Since the gold table contains aggregated values, using "append" is meaningless.
I'd like to know which approach is recommended to update gold tables in case of having a large dataset:
1) Drop the current gold table, and re-create it
2) Overwrite the gold table
The first option seems to be slower if we deal with a large dataset. However, I'd like to know if there is any risk with option 2 (e.g. if the table is not overwritten correctly).
- Labels:
-
GoldLayer
-
Medallion Architecture
-
Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 06:18 AM
@Mohammad Saber
Why not using MERGE? Or even CDF + Merge to do increments.
https://sarnendude.com/delta-lakes-change-data-feed-cdf-demo-in-azure-databricks/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 01:24 PM
When there is aggregated value in the Gold table, I think it should be calculated using all records in the Silver table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 06:10 PM
Hi @Mohammad Saber
Thank you for your question! To assist you better, please take a moment to review the answer and let me know if it best fits your needs.
Please help us select the best solution by clicking on "Select As Best" if it does.
Your feedback will help us ensure that we are providing the best possible service to you. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 10:47 PM
Hi @Vidula Khanna
The answer didn't fit my question.
In the case of using Merge, I found a good article here:

