开发者

SAAS database connection

I am developing a SAAS using MVC 3 .net.

I will have a public database which when someone tries to login it will determine what company the user is logging in from and get the company ID.

It will then access the database using the schema assigned to that company and see if that user is valid.

I want to know would it be better to have a fixed connection string to my public database and individual database connections for each tenant for the multi-tenant database (database would have a one database with shared s开发者_如何学运维chema).


My suggestion is to create username and password for each teneant database and save these credentials in the relative users/customer table in public database.

Public database can have a separate connection string which is only used when tenants need to access shared/private information stored in there.

You may create multiple replica of public/shared database to increase performance between tenants. additionally you can sit with your db admin from scaling point of view for managing connections between tenants, auto closing etc. hope this helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜