SyncCoordinatorDocumentation

DOCUMENTATION / GETTING STARTED

Getting Started

Start the demo, review and change its prepared synchronization configuration, and learn the workflow. Then move to a Core-mode environment connected to your own business databases.

QUICK START

Run the demo

The demo starts Customer Portal, CRM, Field Service, and three different business databases together. It uses the same synchronization path as a normal deployment.

Required for this procedure
  • Windows 11 (win-x64)
  • .NET SDK 10.0.301
  • Aspire CLI 13.4.4
  • Docker Desktop
  • PowerShell or another terminal

Visual Studio and VS Code are optional.

Run these commands from the repository root.

dotnet tool restore
dotnet restore SyncCoordinator.sln
dotnet build SyncCoordinator.sln --no-restore
dotnet test SyncCoordinator.sln --no-build
aspire run --apphost src/SyncCoordinator.AppHost/SyncCoordinator.AppHost.csproj
What starts

Aspire Dashboard shows SyncCoordinator Web, Worker, three sample business applications, and their business databases.

The demo seeds systems, database connections, disabled synchronization rules, and table and column mappings. Synchronization helper tables and triggers are not deployed yet.

FIRST LOGIN

Set the administrator password

On first start, register the administrator password from a browser running on the Web server itself. The setup page is unavailable from a remote computer.

  1. 1
    Open the setup page

    On the Web server, open http://localhost:<Web port>/account/setup.

  2. 2
    Register a password

    Set a password between 12 and 128 characters. The username is always admin.

  3. 3
    Sign in

    Sign in with the password to open the dashboard.

Initial setup and password reset are available only when both the client and requested host are localhost or a loopback address.

DEMO CONFIGURATION

Review and change the demo configuration

Demo configuration is seeded into the management database. Review it first. The same management pages are used to change the demo and to create configuration for real systems.

SYSTEMS

Systems and database connections

Manage the provider, protected connection information, and enabled state for each source and destination. Test the connection before saving changes.

Demo
Three systems are registered

RULES

Synchronization rules

Choose source, destination, direction, and conflict behavior. Demo rules remain disabled until the required database objects are deployed.

Demo
Rules are created and disabled

MAPPINGS

Table and column mappings

Map tables, keys, and fields at both ends. Configure value conversion, fixed values, and deletion behavior here.

Demo
Mappings are configured
Systems page for reviewing database connections and enabled state
SystemsManage database connections and enabled state.
Synchronization rules page for source, destination, and direction
RulesChoose direction and conflict behavior.
Table mapping page for tables, columns, keys, and conversion
MappingsConfigure tables, keys, fields, and value conversion.

DATABASE SETUP

Deploy and enable the rule

This step is required for the demo as well. Open “Deploy to DB” for each rule, review the SQL, and deploy synchronization helper objects to both business databases.

  1. 1
    Review changes and SQL

    Open the objects and generated SQL for both source and destination.

  2. 2
    Deploy to the business databases

    The demo allows direct apply. In production, have a DBA review and run the SQL.

  3. 3
    Verify every database

    Verify that helper tables and trigger definitions exist and match the generated deployment.

  4. 4
    Enable the rule

    After both sides pass verification, enable synchronization in the rule settings.

Database deployment page for reviewing SQL, deploying objects, and verifying definitions
Database deployment

The deployment adds helper tables and triggers for detection and idempotency. It does not change existing applications, business tables, or business columns.

VERIFY THE DEMO

Change data and verify synchronization

After enabling a rule, edit one sample record in Customer Portal or another source. Initial rows were created before trigger deployment, so update a row to begin the first synchronization.

Check the destination

Confirm that mapped fields and values appear in the destination application and database.

Check operations

Review Queue position, processing result, and attempt count on the Operations page.

Try a conflict

Edit the same field on both sides and confirm the configured conflict policy.

USE WITH EXISTING SYSTEMS

Use real business databases

Do not promote demo databases to production. Start Web and Worker in Core mode, then register real business systems in the management console. Configuration and database deployment follow the same workflow you used in the demo.

1. Prepare the Coordinator management database

The management database is a SQL Server database that stores SyncCoordinator configuration, processing state, and conflict history. It is separate from business databases.

EXTERNAL SQL SERVER

Use an existing SQL Server

Set CoordinatorDatabase:UseContainer to false and provide the management database connection string. Docker is not required.

DOCKER

Start the management DB in a container

Set CoordinatorDatabase:UseContainer to true. Aspire manages the SQL Server container and connection string.

2. Select Core mode

Apply this configuration in src/SyncCoordinator.AppHost/appsettings.Development.json. This example uses an external SQL Server.

{
  "RunMode": "Core",
  "CoordinatorDatabase": {
    "UseContainer": false
  }
}

3. Register the management DB connection

For an external SQL Server, store ConnectionStrings:coordinator-db in AppHost User Secrets. Do not write the password to a settings file.

dotnet user-secrets set --project src/SyncCoordinator.AppHost "ConnectionStrings:coordinator-db" "Server=localhost,1433;Database=SyncCoordinator;User ID=your-user;Password=your-password;Encrypt=True;TrustServerCertificate=True;MultipleActiveResultSets=true"

This connection-string step is unnecessary when AppHost starts the management database container.

4. Start and register business databases

aspire run --apphost src/SyncCoordinator.AppHost/SyncCoordinator.AppHost.csproj

Core mode does not seed demo configuration. Sign in, register business databases under Systems, then create rules and mappings and deploy the generated database objects.

Management database migrations for production

Web applies management database migrations automatically in Development. Automatic migration is disabled in Production, so apply the latest migration before deployment.

Set SYNC_COORDINATOR_DESIGN_CONNECTION explicitly. The migration command does not read AppHost User Secrets.

$env:SYNC_COORDINATOR_DESIGN_CONNECTION = "Server=localhost,1433;Database=SyncCoordinator;User ID=your-user;Password=your-password;Encrypt=True;TrustServerCertificate=True;MultipleActiveResultSets=true"
dotnet tool restore
dotnet tool run dotnet-ef database update --project src/SyncCoordinator.Infrastructure/SyncCoordinator.Infrastructure.csproj --startup-project src/SyncCoordinator.Worker/SyncCoordinator.Worker.csproj
Remove-Item Env:SYNC_COORDINATOR_DESIGN_CONNECTION

Before production operation

Align initial data

SyncCoordinator handles changes made after deployment. Align existing data by another method before enabling synchronization.

Use HTTPS

Publish the management console through HTTPS to protect authentication cookies and administrative traffic.

Share and protect encryption keys

When Web and Worker run separately, configure a Key Ring both can access, then protect and back it up.

Separate database permissions

Separate Worker runtime permissions from the DDL permission used to deploy synchronization objects.

NEXT

Read next

Workflow