0

I am creating a system which will have multiple customer. right now i am using same database and table for all customer but i think it'll slow down fetching of record when i'll have hundreds of customer's data in same database. so should i create separate database for each new registered customer dynamically by executing scripts from code? (will use master database to manage all user's connectionstrings)

I'm using entity framework. so same will be possible using EF? will it cause any problem?

Bharat
  • 93
  • 11
  • this is a very general topic – Lei Yang Jul 07 '17 at 05:57
  • 3
    Possible duplicate of [Multiple Databases Vs Single Database with logically partitioned data](https://stackoverflow.com/questions/21844479/multiple-databases-vs-single-database-with-logically-partitioned-data) – mjwills Jul 07 '17 at 05:57
  • Your question is essentially _can EF support multiple DB per app?_ to which the answer is _yes_ –  Jul 07 '17 at 06:26

1 Answers1

0

May be you can use ABP framework to handle multiple database with entity framework. ABP will help you to auto register repositories into IocContainer by adding attribute of all your DBContext (Each DBContext connect to a DB) as following:

[AutoRepositoryTypes(
typeof(IRepository<>),
typeof(IRepository<,>),
typeof(SimpleTaskSystemEfRepositoryBase<>),
typeof(SimpleTaskSystemEfRepositoryBase<,>)
)]
public class SimpleTaskSystemDbContext : AbpDbContext
{
     ...
}