ArcGIS Enterprise

One-way feature service-to-feature service sync

Starting with ArcGIS Enterprise 11.3, an ArcGIS REST API enhancement has been added to support one-way feature service sync between two feature services that are pointing to data in two enterprise geodatabases.

One-way feature service sync workflow diagram
One-way feature service sync workflow diagram

As more organizations are using their GIS workflows exclusively over web services, there is a need to support functionality similar to geodatabase replication in which you maintain edits between production and publication geodatabases, but using feature services. Feature service-to-feature service sync facilitates a similar workflow and also supports branch versioned data, which is not supported by geodatabase replication.

Distributed collaboration is an option, but the synchronization process is run at the organization level. This may not be a good fit in some cases as it requires two or more organizations and the use of at least one hosted feature service.

Let’s have a look at a high-level workflow

Prepare the data for publishing

The first step is to prepare the data in two enterprise geodatabases. The databases can be on the same instance or different instances.

Source enterprise geodatabase – You start with one enterprise geodatabase which stores the source data. The data in the source geodatabase can have the following registration types:

Feature class with branch versioning enabled
Feature class with branch versioning enabled
Feature class with archiving enabled
Feature class with archiving enabled

Target enterprise geodatabase – To complete the workflow, data must be pre-copied from the source geodatabase to a second target enterprise geodatabase. When creating a copy of the source data, keep in mind the following considerations:

The data in the target geodatabase can have the following registration types:

Global IDs must be enabled for non-versioned data without archiving enabled
Global IDs must be enabled for non-versioned data without archiving enabled

Note: Traditional versioning is not a supported registration type with this workflow.

Publish two feature services

Publish two feature services to ArcGIS Enterprise where one is from the source geodatabase and one is from the target geodatabase. The services can either be published by referencing registered data or by copying all data to the hosting server.

Note: If you use one-way feature service-to-feature service sync between two hosted feature services, ensure the services are published to two different Enterprise portals. The feature service pair can be on the same Enterprise portal only if you have one hosted feature service and one referenced feature service or two referenced feature services.

When publishing, ensure the service configuration matches the registration type of choice, for both the source and the target feature services.

To publish branch versioned data, do the following:

Feature service with the Version Management capability enabled
Feature service with the Version Management capability enabled
Feature services with the sync capability enabled
Feature services with the sync capability enabled

Note: In a one-way feature service-to-feature service sync with branch versioned data, the source replica exports changes from the default version only. This is regardless of the Version Creation option selected. The target replica supports both version creation options. If None is selected, edits synchronize directly to the default version. If the Create a version for each downloaded map option is selected, the edits are uploaded into a named branch on the target enterprise geodatabase.

To publish non-versioned archive enabled data, do the following:

Feature service with the sync capability enabled
Feature service with the sync capability enabled

Non-versioned data without archiving enabled is also supported but can only be used a registration type for the data in the target enterprise geodatabase. To publish a feature service that has non-versioned data without archiving enabled, the sync option is not set for the feature service. Non-versioned reference feature services do not support the sync capability, but do allow for an upload-only, server targetType replica to be created and synced. Non-versioned reference feature services include the following service level properties to describe what is supported for this workflow.

Service level properties that supports feature service sync
Service level properties that supports feature service sync

Finally, ensure both feature services have identical data with matching layer IDs for the layers you wish to participate in the sync workflow.

Web feature layers with identical layer IDs
Web feature layers with identical layer IDs

Create the replicas

Use the Create Replica operation, with the replicaOptions set to registerReplicaForServer. This new property added to ArcGIS Enterprise 11.3 allows you to create a replica of the feature service that references the original data in the source feature services, without copying any data.

The RegisterReplicaForServer property
The RegisterReplicaForServer property

From the Create Replica operation response, a replica ID s generated for the source replica.

Replica ID generated after the Create Replica operation on the source feature service
Replica ID generated after the Create Replica operation on the source feature service

Create another replica on the target feature service using the RegisterReplicaForServer option. The RegisterReplicaForServer option allows you to set the target replica ID to match the source replica ID.

Matching replica ID for the target feature service
Matching replica ID for the target feature service

Both the source and the target replica require identical replica IDs for the replica pair to be successfully created.

Synchronize the changes

In a one-way feature service-to-feature services sync workflow, the sync direction is always set to download edits from the source replica and upload edits to the target replica.

Run the Synchronize Replica operation on the source replica first to export any edits made on the source feature service to a mobile geodatabase delta file.

Synchronize Replica operation on the source replica
Synchronize Replica operation on the source replica

Once the edits are exported, the delta file is uploaded to the target feature service. The Synchronize Replica operation is the run again, but this time on the target replica. This will upload the edits and apply them to the target feature service.

Synchronize Replica operation on the target replica
Synchronize Replica operation on the target replica

When the operation is successfully completed, the changes from the source will have been applied to the target feature service.

Synced edits appear in the target web feature layer
Synced edits appear in the target web feature layer

Automated workflow

As this is an advanced workflow, to eliminate possible errors and streamline the synchronization process, we recommend automating the workflow using a script. For this blog, we have developed a sample script that goes over the above workflow.

You can download the script and follow the full workflow using your own feature services.

We hope you find this enhancement helpful, and you will include the feature service-to-feature service sync into your own workflows. We are continuing to develop the feature service-to-feature service sync workflow, by looking into improving the user experience, allowing bi-directional sync and support for utility network and parcel fabrics data.

In the meantime, we encourage you to continue to post your ideas and questions on the Esri Community page.

About the authors

Product Engineer on the Geodatabase team, passionate about making a difference in people's lives using GIS. Hiker and a true Éclair and Crêpe lover in her free time.

Commenting is not enabled for this article.

Next Article

What's new in ArcGIS Field Maps (June 2024)

Read this article