Back to Synchronization
Synchronization

Delta & Incremental Sync

34 views

title: Delta & Incremental Sync category: Synchronization tags: sync, delta, incremental, change-detection, performance priority: Normal

Delta & Incremental Sync

IdentityCenter supports both full synchronization and delta (incremental) synchronization. Understanding the difference and when to use each mode is critical for maintaining up-to-date identity data without overloading your domain controllers or database.

Full Sync vs. Delta Sync

Aspect Full Sync Delta Sync
What it queries All objects matching the LDAP filter Only objects changed since last sync
Data comparison Compares every object against stored data Processes only changed objects
Duration (50K objects) ~5 minutes ~30 seconds (for 500 changes)
DC load Higher (reads all objects) Minimal (reads only changes)
Database I/O Higher (upserts all rows) Minimal (upserts changed rows only)
When to use Initial sync, reconciliation, schema changes Routine scheduled syncs

How Full Sync Works

A full synchronization run follows these steps, orchestrated by the SyncProjectOrchestrator:

  1. Query Step -- The DirectoryQueryService executes the LDAP filter against the configured scope, using paged search with retry logic to retrieve all matching objects
  2. Transform Step -- Attribute mappings are applied to convert raw LDAP data into IdentityCenter's format
  3. Lookup Step -- The ProcessLookupStepAsync method resolves DN references (such as manager) to IdentityCenter Object GUIDs
  4. Upsert Step -- The FastBulkUpsertObjectsAsync method uses a HashSet for deduplication and SQL MERGE for high-performance bulk inserts/updates
  5. Membership Step -- Group membership relationships are processed and stored
  6. Cleanup Step -- Objects that exist in the database but were not returned by the query are evaluated for deletion or deactivation

Performance: FastBulkUpsertObjectsAsync

The bulk upsert method is optimized for full sync scenarios:

  • Uses a HashSet to detect and skip duplicate objects within the same batch
  • Builds SQL MERGE statements that insert new objects or update existing ones in a single database round-trip
  • Skips objects whose attribute values have not changed (hash comparison), even during a full sync
  • Processes objects in configurable batch sizes to balance memory usage and throughput

How Delta Sync Works

Delta synchronization only processes objects that have been modified since the last successful sync run. This dramatically reduces the amount of work at every layer.

Change Detection Methods

IdentityCenter uses these mechanisms to identify changed objects:

Method AD Attribute How It Works
whenChanged whenChanged Compares the object's last modification timestamp against the last sync time
USN Tracking uSNChanged Compares the Update Sequence Number, which increments on every change at the DC level

whenChanged Approach

The sync engine records the timestamp of the last successful sync run. On the next delta sync, it adds a filter condition to only return objects where whenChanged is greater than the last sync time:

(&(objectClass=user)(objectCategory=person)(whenChanged>=20260220120000.0Z))

This approach is simple and effective, but has a caveat: whenChanged reflects the last modification on the DC that was queried. If changes were made on a different DC and have not yet replicated, they may be missed until the next sync.

USN Tracking Approach

Each domain controller maintains a local Update Sequence Number (USN) that increments with every write operation. IdentityCenter can track the highestCommittedUSN from each sync run and query for objects with a uSNChanged value greater than the stored USN.

This is more precise than whenChanged because it is scoped to the specific DC being queried and does not depend on replication timing.

Delta Sync Steps

A delta sync follows the same step pipeline as a full sync, but with a narrower input set:

  1. Query Step -- Only changed objects are returned (filtered by timestamp or USN)
  2. Transform Step -- Same as full sync, but fewer objects to process
  3. Lookup Step -- Only resolves references for changed objects
  4. Upsert Step -- Only inserts/updates the changed rows
  5. Membership Step -- Only processes membership changes for affected groups
  6. Cleanup Step -- Typically skipped during delta sync (no deletions detected without a full scan)

Important: Delta sync does not detect deleted objects. If an object is deleted from Active Directory, it will not appear in the delta query results. Use periodic full syncs for reconciliation and cleanup.

When to Use Each Mode

Use Full Sync For

  • Initial synchronization -- The first time you sync a connection
  • After schema changes -- When you add or modify attribute mappings
  • Periodic reconciliation -- Weekly or monthly to catch any drift or missed changes
  • After restoring from backup -- To ensure the database matches the current directory state
  • Troubleshooting -- When you suspect objects are out of sync

Use Delta Sync For

  • Routine scheduled syncs -- Daily or more frequent syncs to keep data current
  • Large environments -- Where a full sync would take too long to run frequently
  • Low-impact monitoring -- Keeping data fresh without heavy DC or database load

The ideal schedule depends on your environment size and how quickly changes need to be reflected:

Environment Size Delta Frequency Full Sync Frequency Rationale
Small (< 10K) Every 4 hours Daily Full sync is fast enough to run daily
Medium (10K-50K) Every 2 hours Weekly Balance between freshness and load
Large (50K-200K) Every hour Weekly (off-hours) Minimize DC impact, reconcile weekly
Enterprise (200K+) Every 30 minutes Weekly (maintenance window) Near-real-time awareness with weekly cleanup

Tip: Schedule full syncs during off-hours (e.g., weekends or overnight) to minimize impact on domain controllers and the database server.

Configuring Sync Mode

To configure the sync mode for a project:

  1. Navigate to Synchronization > Sync Projects
  2. Open the sync project
  3. In the project settings, select the Sync Mode:
    • Full -- Always runs a full sync
    • Delta -- Runs delta sync using change detection
    • Auto -- Runs delta by default, with periodic full sync at a configured interval
  4. Configure the Last Sync Marker behavior (timestamp or USN)
  5. Save the project

Auto Mode

Auto mode is the recommended setting for most environments. It runs delta syncs on the regular schedule and automatically triggers a full sync at a configured interval (e.g., every 7 days). This gives you the performance benefit of delta sync with the reliability of periodic reconciliation.

Performance Benchmarks

These benchmarks are representative of typical environments running on recommended hardware:

Scenario Objects Mode Duration DB Writes
Small full sync 5,000 Full ~45 seconds 5,000
Medium full sync 50,000 Full ~5 minutes 50,000
Large full sync 200,000 Full ~20 minutes 200,000
Delta (few changes) 50 changed Delta ~10 seconds 50
Delta (moderate changes) 500 changed Delta ~30 seconds 500
Delta (many changes) 5,000 changed Delta ~2 minutes 5,000

Actual performance depends on network latency, DC responsiveness, SQL Server performance, and the number of mapped attributes.

The Sync Pipeline

The SyncProjectOrchestrator routes each step by its StepType. Understanding the pipeline helps when troubleshooting or optimizing:

  ┌──────────┐   ┌───────────┐   ┌──────────┐   ┌──────────┐
  │  Query   │──►│ Transform │──►│  Lookup  │──►│  Upsert  │
  │ (LDAP)   │   │ (Mappings)│   │(Managers)│   │ (MERGE)  │
  └──────────┘   └───────────┘   └──────────┘   └──────────┘
                                                       │
                                                       ▼
                                              ┌────────────────┐
                                              │  Membership    │
                                              │(Groups/Members)│
                                              └────────┬───────┘
                                                       │
                                                       ▼
                                              ┌────────────────┐
                                              │    Cleanup     │
                                              │(Detect Removed)│
                                              └────────────────┘

Each step type can be individually enabled, disabled, or configured per sync project.

Monitoring Sync Performance

Track sync performance over time to detect degradation:

  1. Sync Run History -- Review duration trends for each project
  2. Items Processed / Succeeded / Failed -- Check the JobExecutionHistory for each run
  3. Processing Center -- Monitor active and queued sync jobs
  4. Database Growth -- Monitor the IdentityCenter database size and index fragmentation

If delta sync durations are increasing over time, it may indicate growing change volume or database performance issues (index fragmentation, statistics out of date).

Next Steps

Tags: sync delta incremental change-detection performance

Was this article helpful?

Related Articles

Synchronization Overview
Creating a Sync Project
Auto Sync Projects