close
close

Latest Post

2023 tax law for social benefits could surprise pensioners (video) “Three games a week are too many”

Starting at ArcGIS Enterprise 11.3, an ArcGIS REST API extension was added to support one-way feature service synchronization between two feature services that reference data in two enterprise geodatabases.

One-way feature service synchronization workflow diagram
One-way feature service synchronization workflow diagram

As more organizations use their GIS workflows exclusively through web services, there is a need for functionality similar to geodatabase replication, where you manage changes between production and publishing geodatabases, but using feature services. Synchronization between feature services enables a similar workflow and also supports versioned data after branching, which geodatabase replication does not.

Distributed collaboration is an option, but the synchronization process is performed at the organization level. This may not be the best solution in some cases because it requires two or more organizations and the use of at least one hosted feature service.

Let’s look at a high-level workflow

Preparing data for publication

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

Source enterprise geodatabase – You start with an enterprise geodatabase that 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
  • Not versioned with archiving enabled
Feature class with archiving enabled
Feature class with archiving enabled

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

  • Make sure that the source datasets have global IDs assigned. This way, the copied data will have the same global IDs as the source datasets. This is a fundamental requirement for the feature service synchronization workflow.
  • Use copy and paste or a database backup and restore to move the datasets to the second enterprise geodatabase. This ensures that all geodatabase features, including global IDs, are successfully copied with the data.

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

  • Branch versioned
  • Not versioned with archiving enabled
  • Not versioned and without activated archiving
For non-versioned data without activated archiving, global IDs must be activated
For non-versioned data without activated archiving, global IDs must be activated

note: Traditional versioning is not a supported registration type in this workflow.

Publishing two feature services

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

note: If you use one-way feature service to feature service synchronization between two hosted feature services, make sure that 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 that the service configuration for both the source and target feature services matches the registration type you choose.

To publish data sorted by branch versions, follow these steps:

  • Activate the Version management Ability to take advantage of version control tasks.
Feature service with version control enabled
Feature service with version control enabled
  • The feature services require the synchronization feature to be enabled. Check the Enable synchronization Check box. The synchronization option for version creation can be one of the following: version per downloaded map or none.
Feature services with synchronization enabled
Feature services with synchronization enabled

note: In a one-way feature service-to-feature service synchronization with branched versioned data, the source replica only exports changes from the standard version. This applies regardless of Version creation Option selected. The target replica supports both versioning options. If None is selected, changes are synchronized directly with the standard version. If the Create a version for each downloaded map is selected, the changes are uploaded to a named branch of the target enterprise geodatabase.

To publish data without versioned archiving, follow these steps:

  • The feature services require the synchronization feature to be enabled. Check the Enable synchronization Check box. The “Synchronize version creation” option is not applicable in this case and can only None.
Feature service with synchronization enabled
Feature service with synchronization enabled

Nonversioned data without archiving enabled is also supported, but can only be used as a registration type for the data in the target enterprise geodatabase. To publish a feature service that contains nonversioned data without archiving enabled, the synchronization option is not set for the feature service. Nonversioned reference feature services do not support the synchronization feature, but allow the creation and synchronization of an upload-only replica of type Server targetType. Nonversioned reference feature services include the following service level properties to describe what is supported for this workflow.

Service level properties that support feature service synchronization
Service level properties that support feature service synchronization

Finally, make sure that both feature services have identical data with matching layer IDs for the layers that should participate in the synchronization workflow.

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

Creating the replicas

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

The property “RegisterReplicaForServer”
The property “RegisterReplicaForServer”

The response from the Create Replica operation is used to generate a replica ID for the source replica.

Replica ID generated after the Create Replica operation in the source feature service
Replica ID generated after the Create Replica operation in 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

For the replica pair to be created successfully, the source and destination replicas must have identical replica IDs.

Synchronize the changes

In a one-way synchronization workflow between feature services, the synchronization direction is always set to download changes from the source replica and upload them to the target replica.

First, run the Synchronize Replica operation on the source replica to export any changes made to the source feature service to a mobile geodatabase delta file.

Synchronize replication process on the source replica
Synchronize replication process on the source replica

Once the changes are exported, the delta file is uploaded to the target feature service. The Sync Replica operation is run again, but this time on the target replica. This uploads the changes and applies them to the target feature service.

Synchronize replication process on the target replica
Synchronize replication process on the target replica

If the operation completes successfully, the changes from the source have been applied to the target feature service.

Synchronized changes appear in the target web feature layer
Synchronized changes appear in the target web feature layer

Automated workflow

Since this is an advanced workflow, we recommend automating the workflow using a script to avoid possible errors and streamline the sync process. For this blog, we have developed a sample script that goes through the above workflow.

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

We hope you find this improvement useful and incorporate synchronization between feature services into your own workflows. We are evolving the synchronization between feature services workflow by improving usability, enabling bidirectional synchronization, and supporting data from utility networks and parcel fabrics.

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

About the authors

Diana Muresan

Product engineer on the Geodatabase team who is passionate about using GIS to improve people’s lives. In her free time, she enjoys hiking and loves éclairs and crêpes.

Leave a Reply

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