Qeasy Cloud
Get Started

Real-Time Query of Inventory Prices: A Once-Daily Sync Pattern from YonBIP/YS into Qeasy

· 钟家寿· Integration Solutions· 18 views· 4 min read

What This Strategy Solves

In the inventory middle platform of one retail customer, we kept hitting the same wall: BI dashboards, store replenishment models, and pricing analytics all need a 'yesterday's inventory unit price' snapshot, but the source system only stabilizes its prices after the daily day-end at 2 a.m. Querying during the day returns weighted averages or unsettled prices, which the business team refuses to use. The pattern we deploy on the Qeasy Data Integration Platform is simple: YonBIP/YS finishes day-end at 02:13, then the platform issues a POST to the 'Query Inventory Prices' WebAPI at 02:23, lands the result in Qeasy's middle layer as the daily snapshot, and lets downstream reports / reconciliation consume it. This is a textbook 'read-only pull + middle-layer persistence' pattern, and the target side is even a 'no-op write' node — this article unpacks why.

Data Flow and Field Mapping

Overall direction: YonBIP/YS (source) → Qeasy Data Integration Platform (middle layer) → downstream BI / reconciliation.

The source is YonBIP/YS's Query Inventory Prices endpoint, POST method, effect = QUERY. The response fields we care about:

Source Field (YonBIP/YS)MeaningMiddle-Layer FieldNotes
mainunit_nameMain UOM namemainunit_nameString, auto-fill
specificationSpecification / modelspecificationString
descriptionMaterial descriptiondescriptionString
busitimeBusiness datebusitimeSnapshot date of the day
mainunitMain UOM codemainunitPaired with the name

The target side is an EXECUTE node with the API 'No-op write' (idCheck = true, number/id both 0, response is empty). Its job is to land data into Qeasy's middle-layer table and stop there — not to push to any third-party system. This is a common Qeasy pattern in multi-source aggregation: centralize once in the platform, then distribute, rather than have every strategy push straight downstream.

How to Configure It in Qeasy

In the Qeasy Data Integration Platform's strategy canvas, we did three things:

  1. Source node: choose the YonBIP/YS platform instance, API = Query, effect locked to QUERY, method = POST. Because this is a query endpoint, idCheck, buildModel, and autoFillResponse all stay off by default. Response fields are checked as _autoFillResponse, and Qeasy back-fills them after the request.
  2. Target node: choose Qeasy's own datahub write point, API = No-op write, effect = EXECUTE. The purpose here is to 'receive into the middle layer and stop', with no impact on downstream.
  3. Centralized encoding mapping: a common Qeasy pattern is to keep material codes, UOM codes, and customer codes in the platform's code-table module. In this strategy, mainunit goes through code-table mapping, so we don't repeat conversion logic in every strategy.

Implementation Steps

We rolled this out in three phases; here is what ran cleanly on the customer site.

  • Step 1: full-volume trigger, validate connectivity. Use Qeasy's 'manual trigger' button to pull the day's inventory-price snapshot end-to-end, then verify that specification, description, and mainunit_name match between source and middle layer. The classic gotcha here is automatic leading/trailing whitespace trim, which later looks 'almost the same but won't match'.
  • Step 2: switch to an incremental starting point. Because the source is a query endpoint with no natural incremental field, we adopt the safe pattern for query-style strategies: 'full-volume overwrite of the current business-date partition' — clear the middle-layer rows where busitime = today, then insert the new batch. Do not be misled by the source's name into stitching a delta condition.
  • Step 3: attach the schedule. The source cron is 13 2 * * * (02:13); the Qeasy target cron is 23 2 * * * (02:23), leaving a 10-minute buffer for day-end and cache refresh. A common Qeasy customer pattern is the dual-track of incremental and full-volume: daily schedule for normal cuts, plus one monthly full-volume run to realign history partitions.

Lessons Learned from the Field

  • Classic mistake 1: treating a QUERY endpoint as SYNC. The source effect is QUERY; if you configure it in Qeasy as 'sync write', it will fail the whole batch because there is no ID primary key. Whenever you see idCheck: false, it is almost certainly a pure query.
  • Classic mistake 2: scheduling the target before the source's day-end. YonBIP/YS prices only stabilize after day-end. If the Qeasy node fires before 02:00, you will almost certainly pull unsettled data from the previous day. The safe pattern is: source first, target 10 minutes later.
  • Classic mistake 3: ignoring internationalization of the main UOM name. mainunit_name may be 'piece/box/EA' across organizations; in the Qeasy middle layer, normalize to the code (mainunit) and keep the name only for display.
  • Classic mistake 4: using a normal write target and triggering duplicate lands downstream. Downstream reports pull on their own; if Qeasy also pushes the same prices to a downstream reconciliation system, you will hit idempotency issues. This strategy uses the 'no-op write' specifically to avoid that.
  • Classic mistake 5: field mappings scattered across strategies. Many material/inventory strategies need mainunit. If every strategy writes its own mapping, changing a UOM means editing ten places. In Qeasy, maintain it once in the code table and reference it from the strategy.

When It Fits, When It Doesn't

Fits: day-end-stabilized snapshot queries such as inventory, price, and exchange rate that need to land by business date; moderate data volume (tens of thousands or less); downstream that wants 'one version per day' rather than real-time refresh — reports, reconciliation, pricing analytics.

Doesn't fit: store-level scenarios that need second-level real-time inventory (use push-style real-time inventory instead of a once-daily query); source endpoints that cannot return historical snapshots by business date and instead require change-log-based delta sync; OLAP scenarios at millions-of-rows scale with minute-level latency requirements.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-bip-ys-1738-n54839915-51e37228

Comments