Diference Database for component module


I create 2 project module, first i creat project and build as component, and 2nd i create project and use first module.

Can i set diference database for module one and use it in module 2nd with diference database configuration?
But in case, for use module fisrt in modul 2nd, and fisrt module stay with the database configuration



Hi @dhanan.dwi.rizki1,
Yes, you can. In fact, most cuba-platform components behave like that.

Take a look at reports addon database init scripts, for example.

You just need to make sure that you are creating/updating your addon targeting multiple databases. Whenever a change is done, you need to target the first database, create/update database scripts and save. Then, target the second database and create/update database scripts. And so on.


Hi @peterson.br
How its works? can you explain step by step configuration that database for local component and use multi database datasource?
or where i can get the explaination tutorial for it?

Thank you


Hi Dhanan,
Cuba-Platform definitely supports what you need.

Take a look to this post: https://www.cuba-platform.com/discuss/t/problem-using-association-with-an-entity-from-app-component/12202

It’s important reading documentation about main data store and additional data stores associated to a project to understand the solution: https://doc.cuba-platform.com/studio/#data_stores

I hope this information helped you.


Hi Xavier,

Thank you for your information.
Thats is help me so much to understan datastore in cuba.
I will try to implement additional data store first.

Thanks for your response.