MSBA-273 · Lesson 6 of 12 · 21 min

Data integration patterns

▶ Video coming soon A video version of this lesson is on the way.

By the sixth session the list of integration requests had reached fourteen items, and Rupert noticed that most of them were the same few problems in different clothes. The research export, the meter readings, the supplier list from LedgerPoint, the student hold checks through the Student Records connector and the alarm feed each moved data between Dataverse and another system, and each needed the same decisions: which system owns the data, which way it moves, how often, how changes are detected, and what happens when the two sides disagree. Signe spent the session on those decisions, because a team that names the pattern before choosing the technology makes fewer mistakes.

Five classic patterns

Integration practitioners describe a handful of recurring patterns. Naming them helps a team recognize which problem it is solving.

Five recurring integration patterns.
PatternWhat it doesLumenvale example
MigrationMoves data once from an old system to a new oneLoading historical work orders when the Facilities solution went live
BroadcastSends changes from one source to one or more targets, one way, continuouslyCompleted work orders to the research team's analytics
Bi-directional synchronizationKeeps the same records consistent in two systems that both change themSupplier details if both Facilities and finance edited them
CorrelationSynchronizes only the records that both systems already shareUpdating buildings that exist in both the space system and Dataverse
AggregationCombines data from several sources into one view or storeWork orders, energy readings and alarms combined for reporting

Most real integrations are broadcasts. True bi-directional synchronization, where both systems edit the same fields of the same records, is the hardest pattern to get right and the one Signe tried hardest to avoid. Usually the requirement can be restated as two broadcasts on different fields: finance owns the supplier's bank and tax details, Facilities owns the supplier's trade categories and site contacts, and each side broadcasts its own fields to the other.

Ownership: the system of record

Every piece of data in an integration should have exactly one system of record, the system whose value wins. Ownership can be decided per table or, more often, per column. Writing ownership down settles in advance the question that otherwise arrives as an incident: two systems hold different values, so which one is right? With column-level ownership the answer is immediate, and the integration never writes a column into a system that does not own it.

A supplier record split into two groups of columns. Finance-owned columns such as legal name, tax number and payment terms flow from LedgerPoint to Dataverse. Facilities-owned columns such as trade categories and site contact flow from Dataverse to a report that finance reads. Arrows go one way for each group.
Column-level ownership turns one risky two-way sync into two one-way flows.

Direction and timing

After ownership comes direction and timing. Data can move on request, when a user or process asks for it; on events, as soon as something changes; or in batches, on a schedule. Each has its place.

Timing options for moving data.
TimingMechanismsStrengthsWeaknesses
RequestWeb API calls, custom connectors, virtual tablesAlways current; no copy to maintainDepends on the other system being up and fast
EventWebhooks, Service Bus endpoints, flow triggersNear real time; only changes moveMore moving parts; ordering and duplicates to handle
BatchScheduled jobs, dataflows, Azure Data Factory, change trackingSimple, efficient for volume, easy to rerunData is as old as the last run

Signe pointed out that timing should follow the business need, not the technology the team prefers. The research team looked at work-order trends weekly, so a nightly batch was more than fast enough. The security dispatch tool needed a notification within a minute, so it needed events. Hold checks for students had to reflect the registrar's records at the moment a request was made, so they used a request through the Student Records connector rather than a copy.

Detecting changes with change tracking

Batch integrations need to know what changed since the last run. Reading the whole table every night works for small tables and becomes wasteful quickly. Filtering on the modified-on column misses deletions and can miss rows modified during the run. Dataverse change tracking solves both problems. When the Track changes option is enabled on a table, a client can ask for the table's rows with the header Prefer: odata.track-changes. The response contains the rows and a delta link. On the next run the client requests the delta link and receives only rows created or updated since then, plus entries for rows deleted since then, together with a new delta link for next time.

Listing 6.1: An initial change-tracking request and a later delta request (abbreviated, not executable here).
GET https://lumenvale.crm3.dynamics.com/api/data/v9.2/lcc_suppliers?$select=lcc_name,lcc_suppliernumber,lcc_tradecategories
Prefer: odata.track-changes

HTTP/1.1 200 OK
Preference-Applied: odata.track-changes
{
  "value": [ … every current row on the first run … ],
  "@odata.deltaLink": "https://lumenvale.crm3.dynamics.com/api/data/v9.2/lcc_suppliers?$select=…&$deltatoken=…"
}

GET <the stored delta link>                                  (next night)

{
  "value": [
    { "lcc_name": "Brightwater Mechanical Ltd.", "lcc_suppliernumber": "S-10422", … },
    { "@odata.context": "…$metadata#lcc_suppliers/$deletedEntity", "id": "…", "reason": "deleted" }
  ],
  "@odata.deltaLink": "… a new token for the following run …"
}

Several rules come with change tracking. Once enabled on a table, it cannot be turned off. The calling identity needs organization-level read access to the table. Filter, orderby, expand and top cannot be combined with the track-changes preference, so the delta returns every changed row in the table and the client filters afterwards. The client must store the delta link safely and use it on the next run. And by default changes are kept for seven days: a client that has not synchronized for longer than the retention period receives an error and must start again with a full read. A job that runs nightly has plenty of margin, but a job that is paused for a long holiday shutdown does not, so the runbook for Lumenvale's exports included what to do after a long pause.

Worked problem

How much a delta saves

The supplier table holds 4,800 rows. On a typical night, 35 suppliers are updated, 4 are added and 1 is deleted. How many rows does a full nightly read return, how many does the delta return, and what fraction of the full read is that?

Show solution
  1. A full read returns all 4,800 rows every night and cannot show the deletion.
  2. The delta returns 35 updated plus 4 added rows, plus 1 deleted entry: 40 entries.
  3. 40 divided by 4,800 is about 0.0083, a little under one hundredth of the full read.

Answer: Forty entries instead of 4,800, less than one percent of the full read, and the delete is reported explicitly.

Writing safely: upsert and alternate keys

On the receiving side, the most useful tool is upsert keyed on an alternate key. If the source system's identifier is defined as an alternate key in Dataverse, the integration can PATCH the row addressed by that key: Dataverse updates it if it exists and creates it if it does not. The integration does not need to remember Dataverse GUIDs, and running the same batch twice gives the same result as running it once. That property, idempotency, is what makes a failed batch safe to rerun from the start.

Deletes need a decision of their own. When a row disappears from the source, should the integration delete it in Dataverse, deactivate it, or flag it for review? Deleting is simplest but loses history and can fail if other rows depend on it. For suppliers, Lumenvale's design deactivated the Dataverse row and recorded the date, because old work orders still referred to the supplier.

Handling conflicts and errors

Even with clear ownership, things go wrong. A source row may fail validation in Dataverse; a lookup may refer to a building that does not exist yet; a network error may stop a batch halfway. Good integrations plan for these cases rather than discovering them in production.

Common integration problems and design responses.
ProblemDesign response
A row fails validationWrite it to an error table or log with the reason and continue with the rest
Parent row missingLoad parents first, or hold the child for a later run
Batch stops halfwayRerun from the start; upserts make repeats harmless
Both systems changed a fieldApply the ownership rule; the system of record wins
Source sends the same change twiceIdempotent writes make the repeat change nothing
Counts drift over timeA regular reconciliation report compares counts and totals in both systems

Reconciliation deserves emphasis. Every integration that copies data should have a simple report that compares the two sides: row counts, totals of key amounts and the date of the last successful run. Ysaline had been reconciling the weekly supplier spreadsheet by hand for years and asked that any replacement keep a reconciliation she could read without IT's help.

Tools for each pattern

The pattern and timing usually narrow the tool choice to two or three options.

Tools matched to integration needs.
ToolBest for
Dataflows (Power Query)Low-code scheduled imports into Dataverse tables from many sources, with transformations
Cloud flowsEvent-driven or scheduled integrations of moderate volume maintained by makers
Azure Data Factory or Fabric pipelinesHigh-volume batch movement and transformation managed by data engineers
Custom code with the Web API or SDKComplex logic, unusual sources or strict performance needs
Virtual tablesReading data owned elsewhere without copying it
Link to Microsoft Fabric or Azure Synapse LinkMaking Dataverse data available for analytics

Dynamics 365 finance and operations apps

Organizations that use Dynamics 365 finance and operations apps have additional options, because Microsoft has built integration between those apps and Dataverse. Microsoft's documentation describes virtual entities, which expose finance and operations data in Dataverse without copying it; business events and data events, which notify other systems of changes; and dual-write, which synchronizes data between the two in near real time. The documentation recommends dual-write only for entities that have significant business logic in both systems, and prefers virtual entities and events for other cases. It also notes that Power Platform integration for finance and operations environments has been enabled automatically since May 2025. Lumenvale does not run Dynamics 365 finance; LedgerPoint is an older Windows system, so none of these apply directly, but Signe wanted the team to know the options if a future finance replacement were chosen.

A pattern record for each integration

Rupert added a short pattern record to the integration template, so that every request answered the same questions before any build began.

Listing 6.2: A pattern record for the proposed supplier integration (a design note, not executable).
Integration:      Supplier reference data from LedgerPoint (proposal)
Pattern:          Broadcast, one way, LedgerPoint to Dataverse
System of record: LedgerPoint for legal name, supplier number, tax number, payment terms;
                  Dataverse for trade categories and campus contacts
Timing:           Nightly batch; on-demand refresh by Facilities supervisor
Change detection: LedgerPoint reporting API "changed since" query (to confirm)
Write method:     Upsert on alternate key lcc_suppliernumber
Deletes:          Deactivate in Dataverse, keep history
Errors:           Error table lcc_integrationerror; daily summary to owner
Reconciliation:   Weekly count and active-supplier list for accounts payable
Owner:            Ysaline Dabrowski (business), Signe Tavernier-Mbeki (technical)

Ordering and late-arriving data

Event-driven integrations raise a question that batch jobs rarely face: in what order do changes arrive? Service Bus queues do not guarantee that messages are processed in the order they were sent when several receivers work in parallel, and retries can deliver an older message after a newer one. If a supplier's phone number changes twice in a minute, a receiver that applies the messages out of order ends with the older number. There are three common defenses. The receiver can compare a version or modified-on value in the message with the value already stored and ignore anything older. The sender can use Service Bus sessions so that all messages for one record go, in order, to one receiver. Or the message can carry only the identifier of the changed row, and the receiver reads the current state from the source when it processes the message, so that the order of notifications no longer matters.

The third approach, sometimes called a notification with a fetch, was Signe's favorite for Lumenvale because it was simple and robust. The cost is an extra read for each message, which is usually small compared with the cost of debugging out-of-order updates.

Data quality at the boundary

An integration is also a point where bad data can enter a system at machine speed. A person who types a building code wrongly makes one mistake; a job that maps codes wrongly makes thousands. Signe asked for validation at the boundary: check required values, formats and references before writing, and send anything that fails to the error table rather than writing a partly correct row. She also asked for a dry-run mode in every batch job, which read the source, applied the mappings and reported what would change without writing anything. The first run against production data was always a dry run reviewed by the business owner. Ysaline liked that idea more than any other part of the session, because it meant she would see the effect of the supplier integration on her real data before it touched anything.

Mapping tables belong in data, not code. When LedgerPoint used one set of codes for supplier categories and Facilities another, the mapping between them went into a small Dataverse table that the business owner could maintain. A code change in LedgerPoint then needed a row in that table, not a new release of the integration.

Common mistakes

  • MistakeBuilding a two-way sync because both teams want to edit the data.

    InsteadAssign each column a system of record and build one-way flows.

  • MistakeFiltering on modified-on to find changes.

    InsteadUse change tracking, which also reports deletions and does not miss rows changed during the run.

  • MistakeLeaving a change-tracking job paused longer than the retention period.

    InsteadPlan a full resynchronization after long pauses; the default retention is seven days.

  • MistakeCreating rows with POST in a job that may be rerun.

    InsteadUpsert on an alternate key so reruns are harmless.

  • MistakeStopping the whole batch on the first bad row.

    InsteadLog the bad row with its reason and continue.

  • MistakeChoosing real-time events because they sound better.

    InsteadMatch timing to the business need; nightly is often enough.

Summary and key terms

  • Migration, broadcast, bi-directional sync, correlation and aggregation are the recurring integration patterns; most needs are broadcasts.
  • Every column should have one system of record; column-level ownership turns two-way sync into one-way flows.
  • Data moves on request, on events or in batches; timing follows the business need.
  • Change tracking returns created, updated and deleted rows since a delta token, kept by default for seven days.
  • Upsert on alternate keys makes writes idempotent, so failed batches can be rerun.
  • Plan for errors, missing parents, deletes and reconciliation from the start.
Broadcast
An integration pattern that sends changes one way from a source to one or more targets.
Bi-directional synchronization
Keeping the same records consistent in two systems that both change them.
Change tracking
A Dataverse feature that lets a client retrieve only rows changed or deleted since a previous request.
Delta link
The link returned by a change-tracking request, used to retrieve the next set of changes.
Reconciliation
Comparing counts and totals in two systems to confirm that an integration has kept them consistent.
Dual-write
Microsoft's near-real-time synchronization between Dynamics 365 finance and operations apps and Dataverse.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why did Signe restate the supplier requirement as two broadcasts?

    Show answer

    Because each side owns different columns, so each can send its own columns one way and no conflict can arise.

  2. Which query options cannot be combined with Prefer: odata.track-changes?

    Show answer

    Filter, orderby, expand and top.

  3. An export job was paused for three weeks. What happens when it uses its old delta link?

    Show answer

    With the default seven-day retention, it gets an error and must do a full read.

  4. How should the supplier integration handle a supplier removed from LedgerPoint?

    Show answer

    Deactivate the Dataverse row and record the date, keeping history for old work orders.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz