Writing to a third party backend/database

How would I go about keeping the new ERPNext/Frappe Application in sync with my old system/ database.

I would store a version docField with every record of every one of my own docTypes and whenever I would want to write back a record from the WebUI, some kind of “onSave” hook would have to call my old API to write the changes there as well.
It would receive an error with a newer data from the old system if a write has been made on the old system before the sync happened and I would notify the user in the Frappe WebUI, show the new version and let the user decide what to do about it.

Only if the write in the foreig system succeeds, I would also write to the Frappe Database.

Is this insane? Does this make sense? Is it doable? is there a better solution.

Thank you very much

The biggest question right now is why are you trying to do it?
Because I think that to do such thing you would need to customize every doctype that you need in your old DB.

Interfacing with an old system that is still in use and in relying on its own database.
Sadly you didn’t quite answer my question :slight_smile:

but thank you anyways