Qeasy Cloud
Get Started

Material Master Query Strategy in Practice: Incremental Pull from Xinhai to Qeasy

· 许创贵· Integration Solutions· 39 views· 4 min read
WDT金蝶星瀚物料主数据QUERY_ONLYIncremental Sync轻易云基础资料

What this strategy solves (scenario and value)

In a real project, the customer's master data sits in the ERP system, while downstream business processes (procurement, sales, inventory) all rely on a unified material archive. Pushing materials from the source system to the target system looks simple, but if the code mapping is not designed properly, the numbers on both sides drift apart after three months, and the business team is the first to complain.

The "Query Xinhai Material" strategy solves the starting point problem of basic data synchronization: it uses an incremental time window to steadily pull material master data from Xinhai into the Qeasy data integration platform (hereinafter referred to as Qeasy) as a transit point, and then other write strategies distribute it to downstream systems. When this strategy runs steadily, the synchronization of subsequent sales orders and real-time inventory has a reliable foundation.

Data flow and field mapping (source → intermediate layer → target)

The data flow is "Xinhai → Qeasy intermediate layer → downstream systems". The source side goes through a RESTful query interface, while the target side on Qeasy is a write empty operation (that is, the data is only dropped into the platform intermediate layer without actual downstream writing). The real downstream persistence is handled by subsequent write strategies.

Key field mapping table (based on common practices, subject to the actual return of the source system):

DimensionSource (Xinhai)Intermediate (Qeasy)Note
Codenumbermaterial_codePrimary key, used as deduplication basis downstream
Namenamematerial_nameMaterial Chinese name
Modified timemodifytimeupdate_timeIncremental cursor, used as the starting point for the next pull
Statusstatus(C/A)is_activeOnly sync approved (C) data
PaginationpageNo/pageSize_page_index/_page_sizeAvoid pulling too much at once

A common practice at the customer site is: centralize the three tasks of code mapping, field cleaning, and status filtering into the Qeasy intermediate layer, rather than scattering them across each downstream write strategy — when expanding channels later, you only need to modify one place.

How to configure on Qeasy

  1. Register the source platform: Create a new Xinhai connection in Qeasy, fill in the access address and authentication information, and save the connectivity test result.
  2. Add a strategy, select "Query" as the type: Name the strategy according to business semantics, such as "Query Xinhai Material".
  3. Configure source metadata: Fill in the interface path according to the material convention, request method GET. Focus on the four request parameters:
    • pageNo: starts from 1, automatically incremented by the Qeasy paginator;
    • pageSize: recommended to set to 100, too large will trigger rate limiting, too small will slow down the scheduling;
    • modifytime: bind the variable {{LAST_SYNC_TIME|datetime}} as the incremental cursor; for the first full sync, give a date far earlier than the actual data;
    • status: fixed as C, only pull approved data to avoid draft pollution downstream.
  4. Configure target metadata: Write empty operation, POST to the Qeasy built-in receiver, request/response can be left blank.
  5. Enable automatic response filling: Turn on autoFillResponse, and let the platform automatically maintain pagination, totals, and other metadata.

Implementation steps

Step 1: Confirm the incremental starting point. Before the first execution, align with the customer on the "start time" of the material data. A common practice is to set the initial cursor to the day the organization went live with the material system, and run a full sync once.

Step 2: Trigger full reconciliation. After the full sync is complete, do not rush to enable scheduling. First, sample and compare the material codes and names on both sides to confirm there are no omissions or duplicates before proceeding.

Step 3: Set the scheduling frequency. The source-side crontab of this strategy is usually placed in four daily windows (3 8,12,16,23 * * *), and the target-side fallback scheduling can be set to 23 2 * * * for exception retries and reconciliation. A common two-stage scheduling pattern used by Qeasy customers is: high-frequency incremental on the source side + nightly fallback on the target side, with the intermediate layer filling in the gaps.

Step 4: Enter steady-state operation. Observe 3-5 scheduling cycles, focusing on response latency, whether the cursor advances normally, and whether there are empty runs. After it stabilizes, connect the subsequent downstream write strategies.

Pitfall recap

  1. modifytime cursor forgets to carry the timezone. A typical mistake is to directly fill in the database timestamp; when crossing time zones or adjusting for daylight saving time, the cursor jumps to the future or goes back to the past. The safe approach is to uniformly store in UTC on Qeasy, and then format it into the target system timezone before persistence.
  2. Status filter only half-written. Many teams default the status to "all", resulting in draft data being synced as well, the downstream system rejects it and writes back, and the link becomes messy. We generally filter out non-C statuses on the source side.
  3. Page size is set by gut feeling. Pulling 1000 records at a time causes the source to time out; pulling 10 records at a time causes the scheduling window to fail to complete. It is recommended to start from 100 and fine-tune based on the average interface response time.
  4. Use "today" as the starting point for the first full sync. This is the easiest place to fail — "today" means losing history, and the day after going live, you will find missing materials. Be sure to roll the initial cursor back to the organization's go-live date.
  5. Write empty operation on the target side is misunderstood as "configured wrong". In fact, this is the standard pattern for QUERY_ONLY strategies: after the data lands in the intermediate layer, it is consumed by subsequent write strategies. Making it clear to the customer that "this strategy only handles pulling, not writing" can avoid most misunderstandings.

Applicable and non-applicable scenarios

Applicable: scenarios where basic data such as materials, customers, and suppliers need to be distributed from a single trusted source to multiple downstream systems, and each downstream has its own write strategy; projects that need to retain an intermediate layer for reconciliation, cleaning, and transcoding.

Not applicable: one-to-one upstream and downstream synchronization with millisecond-level real-time requirements (should use event/CDC channels); and scenarios where the source side does not support modifytime increment and can only do full replacement.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-pa6b1d2-1746-n5138ca2c-65cfdada

Comments