Cuba system tables in seperate Database

I have the following scenario:
One customer runs an application on a Oracle Database. Now he wants to maintain/view Data from that existing Database with a new Application that would provide extra functions. The legacy application is still ment to stay in production.

Can I have a (new) Cuba Application, accessing the legacy Oracle Database while having all the cuba specific Tables in a different Database?
I probably would have to check the legacy Tables for specific Cuba fields (like Id)?

As I understand, the new CUBA application should work directly with the old tables which are also used by the legacy application in parallel. This will require at least adding CUBA system fields to the tables (ID, CREATE_TS, CREATED_BY) and creating triggers which will fill in these fields on insert/update by the legacy application. Considering these modifications of live tables, is it really a problem to create a set of CUBA-specific tables in the same database?

Anyway, there is a potential issue with column names: CUBA expects primary keys named ID for keys of integer and UUID type. So if your current primary keys are named differently, I’m not sure that the trick with adding the new unique ID column will suffice. The same problem with the hardcoded CREATE_TS, CREATED_BY fields.

As for your question, the answer is no, you can’t use the standard CUBA mechanisms to load and save entities from different datasources. The application always has a single main datasource which is used by the ORM persistence unit. Of cource you can have any number of additional datasources and work with them through JDBC or by other means. This is often used for integration.