What Is Dual-Write and How to Integrate It with Microsoft Dynamics 365 CRM?

Dual-Write techm
Dual-Write techm

Dual-write is an out-of-the-box framework that provides near real-time, bidirectional data synchronization between Microsoft Dynamics 365 Finance and Operations apps (like Finance, Supply Chain Management, etc.) and Dynamics 365 Customer Engagement apps (often referred to as Dynamics 365 CRM, including Sales, Customer Service, etc).

Essentially, it acts as a bridge between the two environments, ensuring that data relevant to both sides—such as customer records, products, or sales orders—is always consistent and up-to-date in both systems simultaneously. When a change is made in one application, the corresponding change is immediately reflected in the other.

The Need for Dual-Write

Historically, organizations that used both Dynamics 365 F&O and Dynamics 365 CE relied on complex, often custom-built, asynchronous integrations or third-party tools to share data. These methods often led to:

  1. Data Latency: Delays in updates between systems.
  2. Data Inconsistencies: Mismatches and errors due to failed or slow synchronization jobs.
  3. High Maintenance: Extensive time and resources required to manage and troubleshoot the integration.

Dual-write solves these problems by offering a tight, real-time, and synchronous connection, allowing business processes to flow seamlessly across the front office (CRM) and back office (ERP).

Understanding Dual-Write’s Sync and Async Concepts

Dual-write operates primarily as a synchronous framework for real-time transactions, but it also uses asynchronous processing for large-scale data movements. Understanding the difference is key to managing data integrity.

1. Synchronous (Real-Time)

This is the default mode for ongoing, transactional business processes (e.g., creating a new customer, updating a sales order).

  • How it Works: When a user initiates a change (a “write”) in one application (e.g., Dynamics 365 Sales), Dual-write attempts to execute the transaction immediately and simultaneously in the connected application (Dynamics 365 Finance).
  • Data Integrity: If the write fails in either system (e.g., a required field is missing in F&O), the entire transaction is rolled back and fails in the originating system as well. This guarantees high data consistency but requires fast network communication.
  • Example: A Sales Order cannot be completed in CRM until Dual-write confirms it has been successfully created in F&O.

2. Asynchronous (Batch/Non-Real-Time)

Asynchronous processing is used for data loads where immediate, guaranteed consistency is not required, or where the transaction volume is too large for synchronous processing.

  • How it Works: The sending application completes the transaction locally, and the data is then queued and processed by the receiving application later. The originating user is not forced to wait for the update in the other system.
  • Data Integrity: This mode is primarily used for the Initial Synchronization of large amounts of historical data (e.g., loading 100,000 existing customer records) or for scenarios where immediate failure notification isn’t critical.
  • Example: Running the Initial Sync of all existing products from F&O to CE is handled asynchronously to prevent long delays and timeouts.

Key Features of Dual-Write

  • Bidirectional Synchronization: Data flows in both directions (F&O to CE, and CE to F&O).
  • Synchronous Operation: Transactions are typically completed in both systems simultaneously. If a write fails in one system, it fails in the other, maintaining data integrity.
  • Initial Synchronization: A feature that allows you to copy existing data between the two environments before going live with the real-time sync.
  • Extensible: Allows developers to extend the base functionality and create custom mappings for unique business needs.
  • Template Mappings: Provides pre-built table maps for common business scenarios (e.g., Customers, Products, Sales Orders).

How to Integrate Dual-Write (The Setup Process)

Integrating Dual-write involves setting up the connection between your F&O environment and your CE environment (which sits on Microsoft Dataverse).

Step 1: Ensure Prerequisites

Both your F&O and CE environments must be linked to the same Microsoft Entra ID (Azure Active Directory) tenant. The F&O environment must be running a recent, supported version.

Step 2: Link the Environments

  1. In your Dynamics 365 Finance and Operations environment, install the Dual-write core solution package.
  2. Navigate to the Dual-write module within F&O.
  3. Use the ‘Apply solution’ or ‘Link to Dataverse’ option. You will be prompted to select the specific Dataverse environment (your CE instance) you want to connect to. This establishes the secure link.

Step 3: Initial Synchronization and Mapping

  1. Once linked, you will see a list of available table maps (templates) that define which tables in F&O connect to which tables in CE.
    For example, the Customers (Accounts) map connects the F&O CustTable to the Dataverse Account table.
  2. Select the desired table maps (e.g., Customers V3, Products).
  3. For each map, you can review the specific field-level mappings.
  4. Activate the maps by setting their status to ‘Running’.
  5. Perform an ‘Initial Sync’. This takes all existing customer data, for example, and pushes it from one system to the other to ensure both start with the same baseline data. Note: Choose a single direction (e.g., F&O to CE) for the initial sync to avoid potential data conflicts.

Example: Syncing a New Customer Record

Consider a company where the Sales team (using Dynamics 365 Sales/CRM) creates the initial customer record, and the Accounting team (using Dynamics 365 Finance) manages invoicing and payments.

ActionSystemDual-Write FlowResult in the Other System
New Customer CreatedDynamics 365 Sales (CRM)Synchronous Write: Sales creates the ‘Account’ record in Dataverse (CE). Dual-write immediately attempts to create a corresponding ‘Customer’ record in F&O.The Customer Record is immediately created in Dynamics 365 Finance with the same key details (Name, Address, Contact Info).
Credit Limit UpdatedDynamics 365 Finance (F&O)Synchronous Write: The Accounting team updates the ‘Credit Limit’ field in the F&O Customer Record. Dual-write immediately writes this value back to the corresponding field in the CE ‘Account’ record.The Sales team, viewing the customer record in Dynamics 365 Sales, immediately sees the updated Credit Limit value.

Related Post

One thought on “What Is Dual-Write and How to Integrate It with Microsoft Dynamics 365 CRM?”

Leave a Reply

Your email address will not be published. Required fields are marked *