We are working on an Application where each Tenant will share some common data say: Bank Information. Previously, We kept that bank information (All the bank related tables ) in Tenant Scope. Now we want to move the Bank information to a global database where each tenant can access it. Our current approach is 'Database per tenant'
**For Example: ** I have Tennat_1 and it is mapped with Some banks (say ABC, XYZ) Now If we create Tenant_2, we should be able to map these Banks to this new Tenant and other Tenant(s). So on Login, each Tenant will acess their own mapped Bank.
We also wanna manage this Bank data at global level where Tenant is managed.
How can we add these Bank Entities to a global database or shared database.
If added, then how Tenant will access it? Do we need to extend the code in order to acess Global Bank Enitites? ( We seemlessly wants to access these Bank entites, like CurrentUser and CurrentTenant)
How can we implement Domain service for Bank Information like IdentityManager
Please suggest suitable Database Architecture and approach.
Kindly provide the solution as soon as possible.** Also, Let us know if we can get support via calls or online meetings.**
Thanks!
- ABP Framework version: v4.3.1
- UI type: Angular / MVC
- DB provider: EF Core / PostgreSQL
2 Answer(s)
-
0
- How can we add these Bank Entities to a global database or shared database.
- if you don't inherit from
IMultiTenant
interface then the entity will be a shared entity across the tenants.
- if you don't inherit from
- If added, then how Tenant will access it? Do we need to extend the code in order to acess Global Bank Enitites? ( We seemlessly wants to access these Bank entites, like CurrentUser and CurrentTenant)
- If you want to join
Bank
entity withTenant
entity then create a new tableTenantBank
entity. TenantBank entity properties are:TenantId <guid>
,BankId <guid>
Populating a bank dropdown query willSelect bank.name, bank.id from TenantBanks where TenantId = xxxxxxx
- If you want to join
- How can we implement Domain service for Bank Information like IdentityManager
- Create
IBankDomainService : IDomainService
andBankDomainService : DomainService, IBankDomainService
in the*.Domain
project.
- Create
- Please suggest suitable Database Architecture and approach.
- the answers explain the database architecture.
Let us know if we can get support via calls or online meetings
- Sorry but there's no live support.
- How can we add these Bank Entities to a global database or shared database.
-
0
Hi @albert,
Thanks for the response.
How can we add these Bank Entities to a global database or shared database.
- if you don't inherit from IMultiTenant interface then the entity will be a shared entity across the tenants.
By this you mean if Banks are defined for one Tenant then other Tenants will get access to Banks too? Don't we need to add these Bank Entites to Host database? Or Can we keep them in Tenant database?