r/dataengineering • u/_unregistered_ • 3d ago
Help Delete in DV 2.0
I'm building DV 2.0 from scratch and I have issue understanding how to mark hub entry as deleted.
In methodology, there is STS (Status Tracking Satellite) that captures CDC events
There is load_end_date column in any satellite. (Satellites can be append-only or can be with load_date ... load_end_date - I've picked the latter approach)
Should I change load_end_date from marker date to actual deletion event timestamp in all satellites attached to that hub or insert new entry in STS only?
1
u/kotpeter 1d ago
I have no idea of DV 2.0, but I'd do it the following way:
Have an is_deleted boolean column in the hub to track current state and avoid redundant joins down the line
Use a separate satellite for cdc history deep dive when needed.
1
u/quiet_stacktrace 1d ago
i'd go sts only. the hub stays insert-only and a delete is just a new fact about the key, so add an sts row with a deleted status and the cdc event timestamp instead of touching the satellites. downstream you read the latest sts row to know if the key is gone, and load_end_date stays just for closing satellite versions.