Qeasy Cloud
Get Started

Scheduled Cleanup of Inventory Data Results: A Single-Strategy Tutorial on Qeasy

· 王浩宇· Integration Solutions· 19 views· 5 min read

What This Strategy Solves

In a supply chain integration between an order management system and a finance/ERP suite, the integration platform continuously produces intermediate result data during scheduling: current stock, mobile-channel inventory, beverage-channel inventory, and in-transit inventory ledgers all accumulate in the Qeasy Data Integration Platform's result tables. These records are by-products of the runs and should yield space to the next batch as soon as a cycle ends. Without periodic cleanup, the result tables grow bloated, queries slow down, and locating inputs for the next run becomes harder.

The purpose of this strategy is to introduce a cleanup routine that lives outside the normal sync flow and recycles the result sets of specific targets on a schedule, keeping the platform lean.

Data Flow and Field Mapping

There is no business source-to-target flow here. The strategy is a platform-internal maintenance action: it calls a built-in capability of the Qeasy platform to delete result sets on specific targets, then writes a no-op to keep the scheduling chain complete.

Key field mapping:

RoleFieldMeaningNote
Source (platform internal)api = DeleteStrategyDataInvokes the platform's result-data delete APIFixed QUERY type
Sourcetarget_1Current stock result setRequired
Sourcetarget_2Mobile-channel inventory result setOptional
Sourcetarget_3Beverage-channel inventory result setRequired
Sourcetarget_4In-transit inventory ledger result setOptional
Sourcecrontab = 0 0 * * *Triggered daily at 00:00Offset from the target schedule
Target (platform internal)api = No-op writePlaceholder executionNo business data written
Targetcrontab = 1 1 1 1 1Never triggered naturallyOnly invoked explicitly

Two engineering notes: first, target names must match exactly what the upstream inventory strategies write to; keep a single source of truth in Qeasy. Second, the source strategy should be an independently triggerable EXECUTE chain, and the target uses a no-op to avoid duplicate writes.

How to Configure It on Qeasy

Open the Qeasy Data Integration Platform, go to the relevant integration solution, and create a new strategy named "Scheduled Cleanup of Inventory Data Results". Configuration points:

  1. Choose strategy type "Platform internal maintenance" so it is not mixed with normal inventory links in monitoring and alerting.
  2. On the source side, select the platform's own DeleteStrategyData interface. In the request body, mark target_1 (current stock) and target_3 (beverage inventory) as required, and decide whether to enable target_2 and target_4 based on whether the business retains them. The is_required flags must align with the upstream write strategies, otherwise writes and deletes can collide.
  3. On the target side, configure a "no-op write" component with empty request and response, keeping only the id field for chain tracing. This keeps the cleanup visible in the unified schedule panel without polluting the destination.
  4. Scheduling: source crontab is 0 0 * * *; target crontab is 1 1 1 1 1 (a value that never naturally fires) and only triggers via explicit invocation. The "header/body staged" pattern in Qeasy is useful here: cleanup is a header action, not a row-level operation.
  5. Centralized encoding mapping: keep target names and batch-id generation rules as global variables on the platform so the cleanup and write strategies reference the same definitions and never drift apart.

Implementation Steps

We typically roll this cleanup out in three phases:

Phase 1: align the incremental starting point. Before the first run, manually trigger a full inventory sync on Qeasy so the current result sets of all targets are sealed as a baseline batch, then enable the cleanup strategy. Even if the cleanup mistakenly deletes data, you can replay from the baseline.

Phase 2: validate the full trigger. In Qeasy's debug mode, manually trigger DeleteStrategyData once, observe whether the four targets' result sets are correctly emptied, and verify that the target-side no-op chain shows success and that no business data has actually been written. A typical mistake is pointing the target side at a real inventory interface to save effort, which empties stock on every cleanup.

Phase 3: lock the schedule. Fix the source crontab to daily 00:00 and keep the target crontab as a never-naturally-firing value. A common Qeasy customer pattern is "incremental plus full-load dual track": daily inventory sync runs incrementally, while the cleanup runs separately on a daily cadence, never interfering with each other.

In the first week after go-live, manually check the result-set size and the next batch's ingestion time every day; once the curve flattens, hand it over to automated inspection.

Lessons from the Field

  1. Target-name drift. The upstream inventory strategy renames target_1 to ys_inventory but the cleanup strategy is not updated, so it clears empty sets while the real current stock keeps growing. The safe approach is to store target names in Qeasy global variables and have both the write and cleanup strategies reference the same variable.
  2. Treating cleanup as a sync in monitoring. Cleanup produces no business data, yet it triggers monitoring alerts as if it were a failed sync, repeatedly waking up on-call engineers. Configure separate groups and thresholds for internal maintenance strategies in Qeasy's alerting rules.
  3. Wrong target interface. No-op is not the default; you must explicitly pick an executor that does not write to the destination. Some teams, for convenience, point the target side at the upstream inventory interface and zero out stock on every cleanup. We have seen this kind of incident at customer sites at least twice.
  4. No offset on crontab. When the cleanup and the normal inventory sync both fire at 00:00, writes and deletes race; the result set is cleared while the new batch has not yet landed, causing the downstream to briefly read an empty set. Offsetting by one to two hours usually avoids it.
  5. No baseline batch. The first cleanup runs cold, deletes everything, and the team later discovers that some upstream chains actually need historical data preserved. The incremental-start alignment step is not optional.

When It Applies and When It Does Not

Applies: in supply chain systems where result sets accumulate long-term on the Qeasy platform and need daily recycling, particularly multi-target, multi-channel inventory scenarios.

Does not apply: cleaning historical stock tables that live inside the business system itself, fine-grained archiving with complex business conditions, or inventory data subject to external audit retention.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-bip-6322-n4bf58a59-84d75425

Comments