- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Amit,
Different angle on this one. Instead of jumping into "how do I process 2 billion rows efficiently," I'd actually push back on the question a bit first and ask: do I need to process all 2 billion rows every single time, or can I get away with touching only what actually changed?
For something like monthly retail transactions, that question matters a lot. If the data is mostly append-only, the real win isn't a bigger cluster - it's not reprocessing the whole table in the first place. I'd reach for an incremental or CDC-based design before I even think about node count.
Here's roughly how I'd lay it out. Land the raw data in Bronze, partitioned by ingestion date, exactly as it arrives, no transformations. Then for Silver, instead of reading the entire Bronze table every run, only pick up the new partitions since the last successful run - tracked with a checkpoint table, or just using Delta's own commit history. Same idea continues into Gold - only recompute the aggregates for the partitions that actually changed, not the whole historical table.
I've seen this play out on a real migration. We had a Gold layer rebuild that used to be a multi-hour batch job because it recomputed everything from scratch every time. Once we scoped it down to just the current fiscal period's data instead of the full table, that same job dropped to a few minutes. Nothing about the cluster changed - the only thing that changed was how much data we were actually touching.
This shifts the rest of the design too. Cluster sizing stops being about "can this handle 2 billion rows" and becomes "can this comfortably handle this month's slice." Join strategy changes as well - broadcasting your small dimension tables matters a lot less when you're joining against a few million new rows instead of the entire fact table.
The part I'd be honest about in an interview is that this gets genuinely harder the moment corrections to old records show up - and they always do eventually. A correction landing against a transaction from 8 months ago means your "just touch the new partition" plan isn't enough on its own; you need a way to detect and re-touch the old partition too, and your writes need to be idempotent (MERGE, not append) so a failed and retried run doesn't double-count anything.
Full reprocessing still has its place - backfills, schema changes, fixing a systemic data quality issue. But I'd treat "do we actually need to process all of it" as the question to ask first, not the assumption baked into the problem.
That's the trade I'd walk an interviewer through less cluster, more design thinking about what actually needs to move. That's how I'd think about it - happy to hear how you'd weigh it against the full-reprocess approach.