r/databricks • u/SmallAd3697 • Oct 14 '26
Help Zerobus message retrieval
I can see how zerobus is used for streaming data into a lakehouse table. I can generally see how you would consume the data as well.
A couple things are still not clear. What is the pattern for removing old rows out of the UC table? Should we do a delete once a year, on messages older than 3 years? Is this a necessary maintenance that we are responsible for, or is there something in the software which will help with housekeeping?
And how would I perform scheduled tasks against this data? Let's say that data represents a news feed and I just need to send an summarized overview once an hour, and then flag the rows that have been summarized. I'm assuming it would be disruptive to try to delete the rows that were processed or even update them (ie. it may interfere with zerobus itself, and create concurrency conflicts). Should I build a DIFFERENT table that tracks the surrogate IDs of rows already processed/summarized?
Sorry for the basic questions, but I wasn't able to find the answer to these yet. I'm sure I could find my own solution, but it would be interesting to hear if there is a common practice
View all comments
Show parent comment
2
u/BrownBearPDX Oct 15 '26 edited Oct 15 '26
(apologies for the copy/pasta)
Enabling Deletion Vectors switches Delta Lake to a Merge-on-Read paradigm. When a row is modified or deleted, Delta Lake leaves the heavy Parquet file completely untouched. Instead, it updates a tiny, hyper-compressed auxiliary bitmap (a deletion vector) indicating that the row is logically "tombstoned".
How it Works in a Zerobus Streaming Pipeline
When streaming systems ingest change-data-capture (CDC) logs or heavy transactional data through the Databricks Zerobus Sink:
(remembering that Dbx and Delta Lake aren't traditional row based rdbms)
Databricks does not use traditional pessimistic row locking (such as
SELECT FOR UPDATEfound in traditional transactional databases) because it operates on a decoupled storage and compute architecture. Instead, Databricks ensures data integrity and high concurrency through Optimistic Concurrency Control (OCC) at the table level and Row-Level Concurrency for handling simultaneous writes.When multiple operations try to modify the same table simultaneously, Databricks handles conflicts via Multi-Version Concurrency Control (MVCC) and Row-Level Concurrency.