Sharing connections, EfCoreStrategy and multitenancy
See original GitHub issueHi,
i read how i can share connection if i use multidbcontext in #1834 It works well in single database.
Is this multitenancy safe ? I mean, if i use tennant per database concept will code
options.DbContextOptions.UseSqlServer(options.ExistingConnection)
return existingconnection of current tennant ?
If so does it mean that options object is per tennant ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Sharing Connections Furniture Bank - We Furnish Hope
Sharing Connections Furniture Bank has been furnishing hope to Northern Illinois individuals and families in crisis since 1986.
Read more >Best Ef core strategy to run migrations for a lot of databases?
I am using Ef Core in a multi tenant database design project. To get the right connection string in every request I have...
Read more >Multi-tenancy - EF Core
The multiple database version is implemented by passing a different connection string for each tenant. This can be configured at startup by ...
Read more >Multitenancy with Cross-Tenant Users
We currently have a requirement to build a multi-tenant application that has cross-tenant users. That is the business data is separated by ...
Read more >What is multi-tenancy? | Definition from TechTarget
Multi-tenancy applications can share the same users, displays, rules and database schemas. Users can customize the rules to an extent and the database...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not cached. The method below is called every time when a new database connection is needed:
This class is responsible to select correct connection string based on current tenant: https://github.com/aspnetboilerplate/module-zero/blob/dev/src/Abp.ZeroCore.EntityFrameworkCore/Zero/EntityFrameworkCore/DbPerTenantConnectionStringResolver.cs
In brief, it works as expected 😃
thanks for the feedback @HossamZaki.