Hello everyone.
I already read the document of how camunda supporte multi tannacy at camunda website.
There are many information talking how camunda supporte the multi tenancy via table/shcema isolation.
But there are too few information talking how supporte the multi tenancy via database isolation.
So I want to know is there have a interface that use to give the right datasource to the camunda at each request then the camunda use that datasource to connect the database to do something of that need to do.
The hibernate provided a interface like below
public class DataSourceBasedMultiTenantConnnectionProviderImpl extends AbstractDataSourceBasedMultiTenantConnectionProviderImpl {
private static final Logger LOG = LoggerFactory.getLogger(DataSourceBasedMultiTenantConnnectionProviderImpl.class);
@Autowired
private TenantRepository tenantRepository;
private Map<String, DataSource> dataSourceMtApp = new TreeMap<>();
@Override
protected DataSource selectAnyDataSource() {
if (dataSourceMtApp.isEmpty()) {
loadAllTenantDataSource("selectAnyDataSource");
}
return this.dataSourceMtApp.values().iterator().next();
}
@Override
protected DataSource selectDataSource(String tenantIdentifier) {
if (!this.dataSourceMtApp.containsKey(tenantIdentifier)) {
loadAllTenantDataSource("selectDataSource");
}
return this.dataSourceMtApp.get(tenantIdentifier);
}
The interface have two method only. The first return the default datasource to hibernate the second return the datasource of tenant and then hibernate use the datasource to connect the right database at each request.
So please give me more information of how camunda supporte the multi tannacy via database isolation.
Thanks you all.