QuestionQ70

VerifiedData Modelling

An upstream system produces change data capture (CDC) logs that are written to a cloud object-storage directory. Each log record specifies the change type (insert, update, or delete) and the post-change values for every field. The source table has a primary key in the pk_id field.

For auditing, the data governance team wants to retain a complete history of every value that has ever been valid in the source system. For analytics, only the latest value for each record must be retained. The Databricks job ingests these records hourly, although an individual record can change multiple times during an hour.

Which solution satisfies these requirements?

Explanation

Appending all CDC log records to a bronze table retains the full event-level history needed for auditing, including multiple changes to the same primary key within an ingestion interval. A MERGE INTO operation can maintain a silver table as the current-state view by applying insert, update, and delete changes for each pk_id.

Community Discussion

No comments yet. Be the first to start the discussion!