Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Can I create and select databases at runtime ?

$
0
0

Hi,

I am evaluating using ASP.NET Core on a new project.

One of the ideas I have, is to have it use multiple databases and create them on the fly.

I would have one "hard coded" database, ie it can be managed using the EF Foundation as documented.

But then I'd like to have N number of customer specific databases that would be created on the fly. ie each time a new customer signs up, a new database gets created that is customer specific (in that it only holds data for that specific customer).

My application would log in the customer through the main database, and it would then tell the application that this customer is using database DB001 for example. Then all business transactions would be run against that database.

So if my application is running on a host called portal.example.com, customer A would login through that portal, get authenticated against the main database, and all subsequent transactions would happen against database DB_A. For customer B, all subsequent transactions would happen against database DB_B.

I am thinking of this architecture because I want to make absolutely certain that Customer A does not see the data of customer B due to a bug or something, so putting them in separate databases pretty much solves that. That would also make it possible to scale horizontally if more resources are needed.

Any ideas ?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>