A customer asks to be removed from your mailing list, and the support team deletes the contact in the CRM. Three weeks later the same customer receives a campaign email, because the marketing platform still has a copy of the record. The sync between the two systems has run every night without a single error. It just never learned that the row was gone.
This is the most common blind spot in data integration. Creates and updates leave a visible trail: a new id appears, a timestamp changes, a field differs. A delete leaves nothing at all. The row is simply absent, and an absent row looks exactly like a row the sync forgot to ask about.

Photo by Tima Miroshnichenko on Pexels
Why deletes are the hardest change to sync
Most sync jobs work by asking the source system what changed since the last run. That question has a natural answer for new and edited rows, because each carries a modified timestamp or a version number. A deleted row carries nothing, because the row no longer exists to be queried.
So a job that filters on "updated since the last run" will faithfully copy every create and every edit, and will never mention that a thousand rows disappeared. The destination keeps growing, slowly diverging from the source. Reports built on the destination count customers who left, orders that were cancelled, and products that were retired.
The divergence is quiet because nothing fails. Row counts drift by a fraction of a percent per week, which is below the threshold anyone checks. By the time a stakeholder notices, the gap has been widening for months and nobody remembers which deletes were intentional.
Decide what a delete means before you build anything
The word delete covers several different events, and a sync that treats them all the same will do harm. Spend ten minutes separating them with the people who own the data.
A hard delete removes the row from the source entirely. A soft delete keeps the row but flips a flag such as a deleted timestamp or a status of archived. A retention purge removes old rows on a schedule for storage or compliance reasons, and the destination may well want to keep them. An erasure request is a legal obligation to remove a person's data everywhere, and it must reach every copy.
Each one calls for a different downstream action. A soft delete might become a soft delete at the destination. A retention purge at the source should often be ignored. An erasure request must be propagated and then verified. Write the rule for each event in plain language before touching any code, because the code will only be as clear as the rule behind it.
Prefer soft deletes at the source when you control it
If you own the source system, the single most useful change is to stop hard deleting. Replace the delete with an update that sets a deleted timestamp. Now the removal is a visible change like any other, the existing incremental sync picks it up for free, and the destination receives a clear instruction instead of silence.
This is the same idea that many databases and frameworks expose as a built-in pattern. The PostgreSQL documentation describes the building blocks, from partial indexes that keep queries on live rows fast to triggers that can stamp the deletion time automatically. The cost is some extra filtering in the application, and a periodic job that physically removes soft-deleted rows after a retention window.
Keep the window generous and write it down. If the downstream systems sync nightly, a seven day window gives them several chances to see each tombstone before it is purged. A window shorter than your longest plausible outage turns a bad weekend into permanent ghost records.

Photo by Vlad Deep on Pexels
When you cannot change the source, compare key sets
Often the source is a vendor system with no soft delete and no deletion feed. In that case the reliable technique is a key set comparison. On a schedule, fetch only the primary keys from the source, fetch the keys the destination believes are live, and subtract one list from the other. Anything the destination holds that the source no longer returns is a candidate delete.
Keys are small, so this is far cheaper than a full reload, and many APIs let you request a single field. A table with ten million rows still produces a key list that fits comfortably in a few hundred megabytes, and you can compare it in chunks by key range if memory is tight. A common refinement is to hash each chunk and compare hashes first, so you only list individual keys in the ranges that differ.
Treat the result as a candidate list, not a command. Two things can make a key look missing when it is not: a paginated fetch that ended early, and a source that returned a partial page during an outage. Add the safeguards in the next section before acting on any comparison.
Put guardrails around automatic deletion
An automated process that deletes data is only as safe as its worst input. A single bad fetch that returns an empty list would, taken literally, instruct the destination to delete everything. This has happened to real teams, and the recovery is never pleasant.
Build three checks into every delete propagation. First, a threshold: if the job wants to remove more than a small percentage of the destination, such as two or five percent, stop and raise an alert for a human to review. Second, a confirmation pass: require that a key be missing in two consecutive comparisons before it is deleted, which filters out transient fetch errors. Third, a dry run output: write the list of planned deletions to a log or table before executing them, so you can see exactly what would happen.
"Every delete job we ship has a circuit breaker on the count. The question is never whether a bad source response will arrive, only whether the job will believe it." - Dennis Traina, founder of 137Foundry
These checks add a day or two to the build and they pay for themselves the first time an upstream API hiccups. They also give your support team something concrete to point at when someone asks why a record is still there.
Prefer tombstones over silent removal downstream
When the destination removes a record, consider leaving a tombstone behind instead of erasing the row. A tombstone is a minimal marker that says this key existed and was deleted at this time. It holds the identifier and the timestamp, and none of the personal or business data.
Tombstones solve a nasty problem in systems that sync in more than one direction. Without them, a system that has already deleted a row cannot tell the difference between a record it never received and a record it deliberately removed. When the other side re-sends that row during a later sync, the deleted data comes back to life. The tombstone lets the receiver recognize the key and refuse the resurrection.
Message streaming platforms treat this as a first class idea. Apache Kafka log compaction, for example, uses a record with a null value as a tombstone so that consumers can drop a key from their state. Even if you never touch Kafka, the concept transfers directly to a table with a deleted marker column and an expiry date.
Photo by Yuriy Vertikov on Unsplash
Handle ordering so a late delete does not undo a newer record
Deletes arrive out of order more often than people expect. A source system deletes a customer, then a staff member recreates the same customer with the same email address and a new internal id. If the delete event is processed after the create, the new record vanishes.
The defense is to compare versions or timestamps before applying any delete. Store the time of the last change on every destination row, and apply a delete only if its timestamp is newer than what the destination already holds. When the source uses reused natural keys such as an email address or a sku, prefer a surrogate id for matching, or include a generation number that increases each time the key is recreated.
The same logic protects you during replays and backfills. If you ever reprocess an old batch of events, deletes that were correct last month must not be allowed to erase records that were legitimately recreated since. Idempotent, timestamp aware handlers make replays boring, which is exactly how you want them.
Cover the downstream copies you forgot about
A delete rarely stops at the first destination. The row also lives in the reporting warehouse, in the search index, in the cache, in the exported spreadsheets, and in whatever tool the sales team built last year. Each of these is a place a ghost can survive.
Make an inventory of every system that receives data from the source, and decide for each one how deletes arrive. A warehouse might receive them through the same pipeline, while a search index needs an explicit removal call. A cache needs an invalidation, and an exported file may need a documented expiry. For anything you cannot reach automatically, write down who is responsible and how often they check.
This inventory matters most for erasure requests, where a missed copy is a compliance problem and not just a data quality annoyance. The GDPR overview is a reasonable starting point for what a right to erasure expects, and your legal advisor should confirm what applies to your business. Our data integration work regularly begins with exactly this inventory, because the systems people forget are the ones that cause the incident.
Monitor for drift, not just for failures
Finally, assume your delete handling will have gaps and build the means to see them. Failure alerts tell you when a job crashed. They say nothing about a job that succeeds while the destination slowly fills with records the source abandoned.
Track three numbers on a schedule. The first is the live row count at the source and the destination for each synced table, with an alert when the difference exceeds a small tolerance. The second is the number of deletes propagated per run, which should look roughly like a steady rhythm, so a sudden zero or a sudden spike deserves a look. The third is the age of the oldest soft-deleted row waiting to be purged, which tells you whether the cleanup job is still alive.
A small reconciliation report that lists keys present in the destination and missing from the source takes an afternoon to build. Review it weekly at first, then monthly, and you will catch problems while they are still a handful of rows. If you already use an orchestration tool such as Apache Airflow, put the report inside the same pipeline so it runs with everything else.

Photo by serdar barış on Pexels
A short checklist before you ship a sync
When you review an existing integration or design a new one, ask these questions about deletes specifically.
- Which kinds of delete exist at the source, and what should each do downstream?
- Can the source use soft deletes, and how long will tombstones be kept?
- If not, is there a key set comparison, with a threshold and a confirmation pass?
- Do deletes check timestamps so a late delete cannot undo a newer record?
- Is there an inventory of every downstream copy, including caches and exports?
- Would you notice within a week if the destination drifted from the source?
If several answers are "not sure," treat that as the next piece of work. Deletes are unglamorous, and they are also where trust in a dataset is won or lost. A sync that handles them well is one that people stop worrying about.
Plan the unglamorous half of the sync as carefully as the rest. The teams at 137Foundry design integrations so that every row can be created, changed, and removed without leaving anything behind, and that habit is what keeps a dataset trustworthy years after the first sync was written.