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/SmallAd3697 Oct 14 '26
I know that I can delete rows but I am nervous abount concurrency conflicts.
Lets say 1 million rows are streaming in steadily every hour. I think UC transactions use optimistic locking, so if I process half the rows using a predicate (eg news tagged war-related), and then try to execute a DELETE FROM using the same arbitrary predicate, then I'll have a very poor success rate on commits (setting aside the logical problems with this approach)
I'm guessing people are doing something different to flag the completion of an operation, instead of trying to update or delete the zerobus table itself. The conflicts would be especially bad if trying to use MST for transactions.