MSBA-342 · Lesson 6 of 12 · 21 min

Dual-write

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

The sixth row on the integration register was the least settled. Cobalt Ridge's sales team in Hamilton had been piloting a Power Apps model-driven app for tracking municipal tenders, built on Dataverse by a consultant the year before. If the pilot became a full Dynamics 365 Sales rollout, which the sales director wanted for 2027, then customers, contacts, products, prices and quotes would need to live in both Dataverse and finance and operations apps at the same time. The obvious tool for that is dual-write. Kiri Langford asked Desmond to explain dual-write to Prudence and the decision log in the same clinic, so that the decision whether to use it in release 1 would rest on an accurate picture.

This clinic therefore did something different from the others. It built nothing for production. It set up dual-write between Prudence's unified developer environment and its Dataverse environment, mapped one standard table and one custom one, broke them on purpose, and ended with a written recommendation.

What dual-write is

Dual-write is an out-of-box infrastructure that provides near-real-time, bidirectional synchronization between finance and operations apps and Dataverse. When a record that is part of a dual-write map is created, updated or deleted in finance and operations apps, the change is written to Dataverse; when it changes in Dataverse, it is written to finance and operations apps. The data is physically copied: each side has its own row, and dual-write keeps them in step. That makes it different from virtual entities, in the next clinic, where the data stays in finance and operations apps and Dataverse only reads and writes it remotely.

Dual-write is built on data entities on the finance and operations side and tables on the Dataverse side. A table map links one entity to one Dataverse table, field by field, with a direction for each field mapping. Microsoft ships hundreds of ready-made table maps in a set of solutions: a core solution that provides the framework and an application orchestration set that provides maps for customers, vendors, products, sales documents, the global address book and more. Partners and developers can customize maps by adding fields and can create new maps for custom entities.

Two large boxes side by side: finance and operations apps on the left with a data entity CustCustomerV3Entity, and Dataverse on the right with the table account. Between them a band labelled table map, with three field mapping rows showing arrows in both directions. Above the band, a label says live sync, near real time. Below, a separate arrow labelled initial sync, one time, with notes: up to 500,000 rows per run per legal entity, fewer than 10 lookups. At the bottom a note says each side stores its own copy of the row.
Dual-write keeps a copy of each mapped row on both sides, through table maps over data entities and Dataverse tables.

Live sync and initial sync

When a table map runs, it is in live sync: changes flow as they happen. Historically, live sync in dual-write was synchronous: the write on one side waited for the write on the other, and if Dataverse rejected the record, the finance and operations transaction failed too. That tight coupling is the source of both dual-write's strength (both sides agree at all times) and its main operational cost (a problem in one system can block users in the other). In October 2024 Microsoft released an asynchronous mode for dual-write as a public preview, with centralized self-service error management, requiring at least platform update 64, version 10.0.40, and the matching core solution. Any design that depends on the asynchronous mode should check its status on Microsoft Learn before go-live.

Before live sync starts, the two sides must agree on the existing data. That is the job of the initial sync, which copies existing rows from one side to the other when a map is first run. Microsoft documents several limits on it. An initial sync handles up to 500,000 rows per run, and the limit applies per legal entity because each legal entity is processed separately. Initial sync from Dataverse is not supported for table maps with ten or more lookups. Enabling maps with more than forty linked legal entities fails. And for some single-threaded tables, large initial syncs from Dataverse should be avoided because they can exceed the twenty-four-hour limit. For large volumes, Microsoft recommends migrating data into each app separately and skipping the initial sync, then starting live sync.

Initial sync considerations from Microsoft Learn.
TopicDocumented guidance
Rows per initial sync runUp to 500,000, counted per legal entity
Lookups on a map synced from DataverseFewer than 10
Linked legal entitiesMore than 40 causes an error when enabling maps
Activating maps during migrationActivate maps after data migration, not before
Initial sync errors shownOnly the top five errors appear in the error log
Security roles for dual-write usersDual-Write Runtime User and Dual-Write App User in Dataverse

Companies, business units and ownership

Finance and operations data is usually company-specific. Dataverse has no data areas; it has business units and owner teams. Dual-write bridges the gap with a company concept in Dataverse: a company table that mirrors the legal entities, and a company column on company-specific tables, which together with the natural key identifies the row. Each company is linked to a business unit and an owning team, so that records synced from CRCA are owned by the CRCA team in Dataverse and security can follow. When the environments are linked, an administrator chooses which legal entities take part. For Cobalt Ridge that would be CRCA and CRUS, and CRMX once it started trading in January 2027.

Linking the environments happens from the finance and operations side, in the Data management workspace's dual-write page, or as part of setting up the Power Platform integration. The link is one-to-one: one finance and operations environment with one Dataverse environment. In the unified developer experience, the developer environment already has a Dataverse environment behind it, which made the clinic's setup quick. Microsoft's August 2025 update moved dual-write to a new application ID for communication between the two sides, replacing the legacy one, and published a migration guide for existing links. Desmond made a note to confirm that the partner's environment templates already used the new ID.

Customizing a table map

To see how customization works, Prudence extended the standard customer map with one field. Cobalt Ridge stores a municipal tender reference on the customer, a field added in the extension course. Making it flow to Dataverse needed three changes. On the finance and operations side, she added the field to the customer entity through an entity extension. On the Dataverse side, she added a column to the account table in a solution. In the dual-write table map, she refreshed the entity list, added a field mapping between the two, chose bidirectional, and restarted the map. Changes made to a map are saved as a new version; maps and their customizations are moved between environments in Dataverse solutions, which is how the change would travel from the developer environment to UAT.

The customization Prudence made in the clinic. Column names on the Dataverse side are illustrative of the standard map; check the map in your environment.
Table map   Customers V3 (CustCustomerV3Entity)  <->  Accounts (account)
  Status    Running
  Legal entities  CRCA, CRUS

  Field mappings (excerpt)
    CUSTOMERACCOUNT        <->  accountnumber              (key)
    DATAAREAID             <->  msdyn_company.cdm_companycode
    ORGANIZATIONNAME       <->  name
    CUSTOMERGROUPID        <->  msdyn_customergroupid.msdyn_groupid
    CRTENDERREFERENCE      <->  cr_tenderreference         (new, bidirectional)

  Steps
    1. Extend CustCustomerV3Entity with CRTenderReference (CobaltRidgeCustom)
    2. Add column cr_tenderreference to account (Dataverse solution CobaltRidgeSales)
    3. Refresh table list, add mapping, save as new version
    4. Stop and start the map; test both directions

Custom entities can be mapped too. Prudence created a map between CRPumpWarrantyEntity and a new Dataverse table, cr_pumpwarranty. That worked, but it raised the question the rest of the clinic answered: should warranties, which are created and owned in finance and operations apps, ever be copied into Dataverse at all?

Breaking it on purpose

Desmond then broke the map three ways, so that Prudence would recognize the failures later. First, he made the tender reference column in Dataverse shorter than the field in finance and operations apps and saved a long value: the write failed and, with synchronous live sync, the user saving the customer saw an error. Second, he paused the map and changed a customer on both sides: when the map resumed, the queued changes were applied and one side's change won, which showed why business owners must agree which system owns which fields. Third, he created a customer in a legal entity that was not linked: nothing synced, silently, which showed why the list of linked legal entities belongs in the decision log.

Each failure appeared in the dual-write error views, and each needed someone who understood both systems to resolve it. That observation weighed heavily on the recommendation. Dual-write is a powerful tool, but it is an ongoing operational commitment, not a one-time setup.

When dual-write fits

Desmond summarized when dual-write is the right tool. It fits when a Dynamics 365 customer engagement app, such as Sales, Field Service or Customer Service, needs to own or work with copies of finance and operations data in Dataverse with its own business logic, plug-ins and offline use. It fits when both sides must create and update the same records, such as customers created by sales and then invoiced by finance. It fits when near-real-time agreement matters more than loose coupling. It fits less well when Dataverse only needs to read or occasionally write finance and operations data, when data volumes are large, or when no customer engagement app is involved. In those cases, virtual entities are usually simpler, because there is no second copy to keep in step.

A first-pass comparison used in the Cobalt Ridge decision log.
QuestionPoints toward dual-writePoints toward virtual entities
Does a customer engagement app own logic on the records?Yes, Sales or Field ServiceNo, Power Apps or flows only
Who creates the records?Both sidesFinance and operations apps
Is a physical copy needed in Dataverse?Yes, for plug-ins, offline or reportingNo, live reads are enough
Data volumeModerate, within sync limitsAny; nothing is copied
Operational effort acceptedTwo-system support teamMostly one system

The recommendation

The recommendation Desmond and Prudence wrote for the decision log was short. Do not enable dual-write in release 1, because no customer engagement app is in scope and the tender pilot only needs to read customers and products. Use virtual entities for the pilot and for the field technician app. Revisit dual-write if Dynamics 365 Sales is approved for 2027, and in that case plan the customer, contact and product maps from the standard solutions, migrate data into both apps separately rather than relying on initial sync for the historic records, and staff a support role that understands both systems. Kiri accepted it, and the register's dual-write row turned from amber to grey with a note: decision D-INT-06, revisit with the Sales business case.

Developer work in a dual-write project

Even though dual-write is mostly configuration, a real project generates developer work, and Desmond listed it so that the decision log would show the full cost. Entity work comes first: every custom field that must flow needs an entity extension, every custom table needs an entity with a natural key that both sides understand, and every entity used by dual-write must perform well on single-record writes, because live sync writes one record at a time. Dataverse work comes second: columns, relationships, business rules and sometimes plug-ins on the Dataverse side, packaged in solutions. Map work comes third: field mappings, transforms between value lists, filters that limit which rows sync, and the order in which maps start, because a sales order line map cannot run before the product and customer maps it depends on.

Value lists deserve special mention. A finance and operations enum, such as the warranty status, appears in Dataverse as a choice column. The map must translate each enum value into the matching choice value and back, and if someone later adds a value to one side and forgets the other, records with the new value fail to sync. Desmond's rule from the business events clinic applied again: treat value lists as contracts, change them on both sides together, and add the change to the release checklist.

Filters are the other subtle area. A map can carry a filter on each side, for example to sync only customers in a given customer group. Filters are powerful but easy to misunderstand. A record that falls outside the filter after an update stops syncing, and its copy on the other side stays as it was, so the two sides drift. Prudence tested this in the clinic by changing a customer's group to one outside the filter and watching the Dataverse copy freeze. The lesson was that filters should describe stable properties of a record, not ones that change in the normal course of business.

Testing and supporting dual-write

Testing dual-write means testing both directions, both legal entities and the failure cases. Desmond's test plan for a future Sales rollout had four parts. Create and update a record on each side and confirm it appears on the other within seconds. Repeat in each linked legal entity. Force a failure on each side, such as a missing required lookup, and confirm the error is visible and the user sees a clear message. And pause and resume each map with changes queued on both sides, confirming that the business owners accept which change wins. The plan also named the people who would watch the dual-write error views each day after go-live: one from the finance and operations support team and one from the Dataverse side.

Support also includes upgrades. Microsoft updates the dual-write solutions and the platform on its own schedule. Each update can add maps, fix maps, or change prerequisites, as the 2024 asynchronous preview and the 2025 application ID change showed. A customer using dual-write must read the release notes for dual-write as well as for finance and operations apps and Dataverse, and test map behaviour in a sandbox after each update. That was one more reason Desmond wanted the decision deferred until a Sales rollout would justify the effort.

Worked problem

Reading an initial sync failure

In a test, Prudence starts the customer map with initial sync from Dataverse to finance and operations apps for 620,000 accounts in one legal entity, using a map she has extended to twelve lookups. The sync fails. Which documented limits did the test break, and what should the plan be?

Show solution
  1. The run exceeds 500,000 rows for one legal entity, the documented initial sync limit.
  2. Initial sync from Dataverse is not supported for maps with ten or more lookups; twelve breaks that rule.
  3. Microsoft's workaround for lookups is to remove non-mandatory lookups, sync, then add the remaining lookups back in batches and restart live sync with initial sync skipped.
  4. For the volume, the better plan is to migrate the accounts into each app separately with data management tools and start live sync with initial sync skipped.

Answer: Two limits were broken: rows per run and number of lookups. Migrate the data separately and start live sync without initial sync.

Common mistakes

  • MistakeChoosing dual-write because Dataverse needs to read a few finance tables.

    InsteadUse virtual entities when Dataverse only needs live access, not a second copy.

  • MistakeActivating dual-write maps before the data migration.

    InsteadMigrate first, then activate maps, as Microsoft recommends.

  • MistakeLeaving field ownership undecided.

    InsteadAgree which system owns each mapped field, so conflicting edits do not surprise anyone.

  • MistakeTreating dual-write as a one-time setup.

    InsteadPlan an ongoing support role that understands both systems and the error views.

Summary and key terms

  • Dual-write provides near-real-time, bidirectional synchronization between finance and operations apps and Dataverse, keeping a copy on each side.
  • Table maps link data entities to Dataverse tables field by field, and can be customized and moved in solutions.
  • Initial sync has documented limits, including 500,000 rows per run per legal entity and fewer than 10 lookups from Dataverse.
  • Companies in Dataverse mirror legal entities and link to business units and owner teams.
  • Dual-write suits customer engagement apps that own copies of the data; virtual entities suit live access without copies.
Dual-write
Out-of-box infrastructure for near-real-time, bidirectional synchronization between finance and operations apps and Dataverse.
Table map
A dual-write mapping between one data entity and one Dataverse table.
Live sync
The ongoing synchronization of changes on a running table map.
Initial sync
The one-time copy of existing rows when a table map is first run.
Company concept
The Dataverse company table and column that represent finance and operations legal entities.
Asynchronous dual-write
A mode released as a public preview in October 2024 that moves data asynchronously with central error management.

Practice problems

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

  1. Why does a failed write in Dataverse block a user saving a customer in finance and operations apps under synchronous live sync?

    Show answer

    Because the two writes are coupled: the finance and operations transaction waits for the Dataverse write and fails if it fails.

  2. What three changes were needed to sync the tender reference field?

    Show answer

    An entity extension field, a Dataverse column, and a field mapping in the table map.

  3. Why did the decision log choose virtual entities for release 1?

    Show answer

    No customer engagement app was in scope, and the pilot and technician app only needed live access, not copies.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz