I have an application(App A) that uses orientdb(DB#1) as the database. Now we are developing another application(App B) that uses PostgreSQL(DB #2) as the database.

We now have a requirement wherein we need to list a few entities of app 'A' in app 'B' and also allow users to modify these entities in app B. All the changes that are performed on the entities of app 'A' in app 'B' should be reflected in DB #1. After a series of discussions internally with the team, we are convinced to migrate required entities data from db #1 to db #2 at once and later dynamically update DB #2 with records that get created/updated in db #1 and vice-versa.
Could someone please suggest efficient ways of keeping db #1 and db #2 in sync?

Note:

1. We are not interested in syncing db #1 and db #2 in real time, eventual consistency is fine for us.
2. Orientdb provides 2 kinds of hooks
	* Dynamic hooks( <https://orientdb.com/docs/last/Dynamic-Hooks.html>) which work at the schema level, not across databases.
	* Java hooks(<https://orientdb.com/docs/last/Java-Hooks.html>), which requires you to create a jar and place it in lib folder of orientdb.We ruled out this option since we have multiple instances of orientdb running in different regions which means every time we update a jar we need to update in all the instances of oriendb and debugging can be difficult since this jar runs as a subprocess inside oriendb.

Some of the approaches we considered:

1. Whenever a user creates/updates an entity in app 'A', create/update the respective record in db #1 and as soon we updated it in db # 1, in the application layer(java), push an equivalent Postgres sql query to update the record in db #2 into a persistent queue and process these messages asynchronously and vice-versa