One Strategy in Depth: How Qeasy Periodically Cleans Up Integration History Older Than 7 Days
What This Strategy Solves
In supply-chain integrations between MySQL and ERP-style systems, every day produces new sales orders, refunds, and reconciliation records. After a few months, the intermediate tables in the target database pile up with historical data. Queries slow down, backups balloon, and cross-database comparisons mistake old data for new data.
The single strategy we are zooming in on — "Delete all data older than 7 days" — looks trivial, but it is actually the only "slimming-down strategy" in the whole integration chain. It does not move any business fields. Its only job is to periodically clean up, per integration flow, records that fall outside the retention window.
On the Qeasy data integration platform, this strategy is composed of two schedules: a source endpoint that calls DeleteStrategyData (a QUERY action), and a target endpoint that writes a no-op (an EXECUTE action). Below we break it down.
Data Flow and Field Mapping
Even though this strategy has no "business fields" on the surface, its request and response fields still need to be mapped strictly, otherwise the scheduler will treat it as a normal sync.
| Position | Field | Type | Required | Description |
|---|---|---|---|---|
| Source (request) | target_1 | object | yes | The integration flow object(s) to process; selectable in the Qeasy UI |
| Source (response) | datetime | string | no | Auto-filled, records when the delete happened |
| Source (response) | params | string | no | Auto-filled, snapshot of request parameters |
| Target (request/response) | — | — | — | All empty, acts as a no-op placeholder |
The source is a type=WebAPI, effect=QUERY, method=POST action; the target is a type=WebAPI, effect=EXECUTE, method=POST no-op action. This "delete on the source, close out on the target" composition is one of the common patterns we see among Qeasy customers — the core action lands on the source, the target only closes the loop, so that the cleanup does not pollute business tables.
How to Configure It on Qeasy
There are three points to get right in the UI:
- Pick the source flows: In the
target_1field, check the business flows you want cleaned up (for example, sales-outbound sync or refund sync). Multiple flows are supported, comma-separated, and the platform will iterate through them. - Retention window: The retention period is fixed at 7 days on the platform side. It is written into the request as "N days before current time"; you do not need to modify the API.
- No-op target: The target uses
write no-op, with empty request and response bodies. It only serves as a placeholder that lets the log show a "cleanup completed" marker.
We recommend leaving the two switches at default: idCheck=true lets the platform validate flow IDs, and autoFillResponse=true lets datetime and params be filled in automatically, sparing you manual assembly.
Implementation Steps
When we deployed this strategy at customer sites, we typically followed three steps:
Step 1: Confirm the starting point — stabilize the business flows first. On Qeasy, the cleanup strategy is an "auxiliary strategy" and must not go live before the business syncs. A common practice we have seen is to wait until the core sales/refund syncs have run for one or two full schedule windows and confirmed data is landing, then attach the cleanup strategy.
Step 2: Trigger a full cleanup — run it manually the first time. The first time the cleanup strategy runs, we recommend manually triggering it in Qeasy to clear, in one shot, all stock history older than 7 days under the flow dimension. This prevents the daily schedule from not yet being in effect on the go-live day while old data continues to accumulate.
Step 3: Configure the schedule frequency. The source crontab is set to 1 4 * * * (every day at 04:01), and the target crontab to 23 9 * * * (every day at 09:23). The two times are deliberately offset: the cleanup runs during the business off-peak, and the close-out runs during business hours so that a human can spot-check it. The frequency can also be weekly or monthly, but daily cleanup is the default rhythm we see most often among Qeasy customers.
Once it is stable, you can wire the datetime returned by "cleanup completed" into a monitoring alert — if it has not been filled in for three consecutive days, fire an alert, so that you notice quickly if the cleanup strategy has been accidentally stopped.
Pitfalls We Have Seen
- Typical mistake: putting the cleanup strategy in the same schedule as the business sync. If the business sync fails because of a network blip, the cleanup strategy may treat intermediate data that has not yet landed that day as "7-day-old data" and delete it. The safe approach is to give the cleanup strategy its own independent flow with no dependencies.
- Typical mistake: hard-coding the retention window as "system current time" instead of "data write time". If the source data itself lands with a delay, you get the weird situation where "data written 6 days ago gets deleted." At customer sites we require that judgment must be based on the write-time field, and the QUERY action on Qeasy explicitly passes that time field to
target_1. - Typical mistake: not reviewing disk and index usage on the target database after cleanup. Deletes are asynchronous and physical space is not released immediately. We recommend running OPTIMIZE TABLE (or its database equivalent) once a month. A common Qeasy customer pattern is to spin up another auxiliary strategy for this step.
- Typical mistake: ignoring the ordering of multiple checked flows. When
target_1checks multiple business flows, the platform processes them in ascending flow-ID order; if one of those flows is still being written to, cleanup will race it for locks. The safe approach is to set the cleanup schedule at least 30 minutes later than the business schedule. - Typical mistake: not isolating the test environment. Once the cleanup strategy is misconfigured, historical data in production can be deleted irreversibly. At customer sites we always insist on running it in a test tenant for 7 days first, and only then migrating to production.
Where It Applies and Where It Does Not
Applies: Cleaning up intermediate tables for business documents that have heavy throughput, a defined retention window (7/15/30 days), and no audit requirement for historical data — especially MySQL scenarios that need periodic slimming.
Does not apply: Data with long-term compliance retention requirements (finance, order master data), audit logs that need historical traceability, and flows where the "delete" itself would break business consistency (for example, target tables with foreign-key dependencies). For these, you should switch to an archival strategy rather than a hard delete.