On an update event of a logical single record distributed over two relations, I want to call a backend method (it's a REST API call synchronizing data with the external server). This synchronization method can be called only once per record. If the update change involves only one of two relations, it's ok, the synchronization method will be called once by a trigger of the first or the second relation. If the single update involves data in the two relations, two triggers will fire and the synchronization method needs to distinguish if was called already in the given SQL transaction (I understand that REI3, on the save event, executes such two SQL tables updates under a single SQL transaction, right?).
What adds complexity is the asynchronous nature of the REST calls in REI3. Even if the synchronization call is implemented as an idempotent operation (it produces the same result regardless of how many times it's executed), as the method is not an atomic request to the foreign server, when called twice in parallel it may produce data inconsistency (the proper handling would probably require a locking mechanism).
Thus, I was wondering if any methodology is recommended to REI3 developers to cover such scenarios.