AnsweredAssumed Answered

Synchronising two layers

Question asked by micsbjc on Sep 21, 2018
Latest reply on Sep 22, 2018 by asrujit_pb

We have many mapservices (hundreds) using many layers (hundreds).

The layers are backed by ESRI Enterprise Geodatabase on SQL Server 2016.

The published layers are all stored in the one database ('SDI')

The required availability of the mapservices is close to 24*7

A subset of the layers are sourced from versioned layers maintained using ESRI tools

These layers need to be published on an 'as required' basis (some daily, some adhoc)

The versioned layers are all stored in a separate database ('SDIDEV')

What ESRI facilities are available to publish the updated data from SDIDEV to SDI?

From what I can understand (I am a DBA, not an ESRI expert) the simpliest way is to

  • stop all mapservices using the layer
  • Use Python (or FME) to
    • delete the contents of the target layer
    • copy the source data to the target layer
  • Start the mapservices

This obviously

  • results in mapservice outages 
  • runs the risk of a failure in the process leaving the target data incomplete
  • cannot be simply automated

A second alternative would be to

  • Create an ESRI EDIT service that described every target layer
  • Create a script (anything that can read SQL/ESRI layers and call a webservice) to
    • Determine delete/insert statements required to bring the two layers into sync
    • Create json string of required updates for a layer
    • Invoke ESRI EDIT service passing the json string

Before I start writing the implementation of the second alternative I thought it worth asking

  • Is there a better way of achieving these requirements?
  • Has somone implemented something like my second alternative so that I do not have to start from scratch?