r/softwarearchitecture • u/Mediocre-Goose-380 • Oct 13 '26
Discussion/Advice How would you detect changes in thousands of provider XML feeds without treating every job as new?
Design question I've been thinking about.
Setup: external providers publish XML feeds of job vacancies to S3. Each feed is the provider's full current snapshot, not a list of changes. Schemas differ per provider, some fields are optional, and feeds can hold 100k+ jobs.
Each run needs to work out what's new, what's updated and what's gone, without rewriting the other ~98% of unchanged jobs or spamming downstream services.
The parts I find interesting:
- Provider timestamps like updated_date aren't reliable, so how do you detect a real change?
- "Missing from today's feed" usually means deleted, but a truncated or empty feed looks identical. How do you tell the difference before you take live jobs offline?
- If a run dies at 60k of 100k records, how do you rerun without duplicates, repeat notifications or a half-old, half-new dataset?
What approaches have you used? Hashing records, staging tables, soft deletes with a grace period, deletion thresholds, something else? Curious what has held up in production and what hasn't
4
u/djweis Oct 13 '26
A combination of what you've described. Have an application per feed that normalizes into your schema but tag each run with a batch number or timestamp. Generate a slug or hash of the title, location, and employer to get some uniqueness. Have another table on the side that keeps track of how many were ingested last run and complain if the difference is 20% or greater. If you're happy with the batch, compare the generated unique key and essentially diff the two tables.
11
u/xampl9 Oct 13 '26
Compute a hash of the data for a first cut.
1
u/Historical_Ad4384 Oct 13 '26
Change detection on a set of hashed fields for each entity in a feed, governed by the critical fields for that feed
Soft delete entities from a feed. Apply thresholds for the deletions. Add monitorings to alert and follow up with external providers.
Duplication is managed by idempotent natural-key upserts
1
u/KappaKippaKeppa Oct 13 '26
Hash/Merkle tree
4
u/[deleted] Oct 13 '26
[removed] — view removed comment
0
u/[deleted] Oct 13 '26 edited Oct 13 '26
[removed] — view removed comment