HomeGuidesAPILog In

Multi-environment Architecture Sync

For multi-environment architectures, for example one with Development, Testing, and Production environments, it can be important to consider how solution artefacts (such as projects and data source definitions) move between environments.

SmartIQ provides a "sync" API, consisting of an "import" and "export" endpoint, to enable the development of solutions which automate the progression of artefacts from one environment to another.

For full details of the API see API Developer Guide. The sync endpoints are /projects/sync/export and /projects/sync/import.

Considerations for setting up sync between environments

There are a number of considerations which should be followed to avoid conflicts/problems syncing between environments.

Use separate databases

In a multi-tenanted cloud hosted environment the source and destination environments must be on separate databases.

Start from a clone

The sync API checks the internal IDs of objects as well as their names. For instance, a project called "My Form" will not be updated on sync if the IDs do not match between the source and destination environments. To prevent conflicts from a sync, environments which will be the target of a sync should be created by cloning the database of the source environment.

Avoid making changes in downstream environments

As changes to synced objects will overwrite the copy in the destination environment, it is recommended to ensure that changes are not made in the destination environment. Rather, changes should be made in the source environment and synced to the destination. This also allows for better reasoning about the state of environments relative to one another - such as knowing which environment of a pair has newer copies of forms.

Push one-way

To avoid overwriting items unintentionally, sync should be performed from lower environments to higher ones (e.g. from Development to Test, but not from Test to Development). In conjunction with the above recommendation this can help to ensure that the destination environment is never "ahead" of the source environment (and thus that it won't behave unexpectedly compared to the source).