When you import a vendor feed with 50,000 products but only 200 have actually changed since the last run, processing all 50,000 wastes time and resources. Diff updates solve this by comparing incoming data against what is already in SureDone and only processing items that have actually changed.
How It Works
When diff_update is enabled, the engine compares each incoming item's values against the corresponding values stored in SureDone. If none of the monitored fields have changed, the item is skipped entirely -- it never makes it into the bulk update file.
The comparison is field-by-field:
- The engine reads the current SureDone value for each diff field.
- It trims whitespace from string values for a clean comparison.
- It compares the incoming vendor value against the stored SureDone value.
- If any monitored field differs, the item is processed. If all monitored fields match, the item is skipped.
Enabling Diff Updates
"diff_update": true
That is all you need for basic diff checking. When diff_fields is not specified, the engine checks all mapped fields for changes. If any field in the item differs from what is in SureDone, the item is processed.
Specifying Diff Fields
In most cases, you do not care if every field changed -- you only want to update when specific fields like stock or price change. Use diff_fields to narrow the comparison:
"diff_update": true, "diff_fields": ["stock", "price"]
Now the engine only checks stock and price. Even if other mapped fields like title or description changed in the vendor feed, the item is skipped unless stock or price is different.
Diff Tolerance
For numeric fields like price, you may not want tiny rounding differences to trigger an update. Use diff_tolerance to set an acceptable range:
"diff_update": true, "diff_fields": ["price"], "diff_tolerance": 0.01
With a tolerance of 0.01, a price of 29.99 in SureDone and 29.989 from the vendor are considered equal. The item would not be processed because the difference (0.001) falls within the tolerance range.
This is particularly useful when:
- Vendor prices come with extra decimal precision
- Currency conversion introduces minor rounding differences
- You want to avoid churning channel listings over sub-penny price changes
When to Disable Diff Updates
There are scenarios where you want to send all data every time, regardless of changes:
- Full catalog syncs where the destination system expects a complete feed
- Channel relisting where you need to push all products to re-list them
- Debugging when you want to verify all items are processing correctly
In these cases, explicitly set:
"diff_update": false
Performance Impact
Diff updates can dramatically reduce processing time and bulk file size. Consider this example:
| Scenario | Items in Feed | Items Changed | Items Processed | Approx. Time |
|---|---|---|---|---|
| Without diff | 50,000 | 200 | 50,000 | 45 minutes |
| With diff (all fields) | 50,000 | 500 | 500 | 2 minutes |
| With diff (stock + price only) | 50,000 | 200 | 200 | 1 minute |
The savings come from:
- Smaller bulk files -- Only changed items are written to the update file.
- Fewer database writes -- SureDone does not process unchanged items.
- Fewer channel syncs -- Channels only receive updates for items that actually changed.
Complete Example
{
"name": "Vendor Price & Stock Sync",
"vendor": "Parts Warehouse",
"active": true,
"schedule": "0 */2 * * *",
"type": "products",
"action": "import",
"connection": {
"type": "sftp",
"address": "sftp.partswarehouse.com",
"username": "{{sftp_user}}",
"password": "{{sftp_pass}}",
"path": "/feeds/",
"port": 22
},
"file_configs": [
{
"name": "inventory_update.csv",
"update": "edit",
"field_map": {
"guid": "PartNumber",
"price": "DealerCost",
"stock": "QtyAvailable",
"title": "Description",
"weight": "ShipWeight"
},
"diff_update": true,
"diff_fields": ["price", "stock"],
"diff_tolerance": 0.01
}
]
}
This automation:
- Imports every 2 hours from an SFTP server
- Maps 5 fields from the vendor CSV
- Only processes items where price or stock has changed
- Ignores price differences smaller than one cent
- Title and weight changes alone will not trigger an update