Preventing Duplicates on automatically generated Unique value TEA in a Distributed Architecture

Greetings community and developers,

We are planning to implement a distributed database architecture for our DHIS2 tracker in which local instances will periodically sync to a central DHIS2 instance.

However, each of the Tracked Entity Instances have an Tracked Entity Attribute that auto generates unique values and uses this as a front end Unique Identifier for the TEIs. My major concern is possibility of generating duplicate values on this Unique value TEA.

How can I prevent this from happening? Any suggestions will be highly appreciated.

image

Thanks,

Nguza