2

Does the Servicestack support the Single Deployment with Single Database multi-tenancy method? The documentation says only about multiple databases.

Thanks

Chinthaka
  • 966
  • 1
  • 13
  • 42

1 Answers1

2

The multi-tenancy is centered around having different connection strings per tenant but you could potentially override GetDbConnection(IRequest) in your AppHost to change the Users schema on DB Connection for each request.

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390
  • you mean, having multiple schemas for each tenant. Am I correct? As I have read, a multi-tenancy system can have Single Deployment - Multiple Database or Single Deployment - Single Database or Single Deployment - Hybrid Databases). I need to implement a system with Single Deployment - Single Database. – Chinthaka May 12 '17 at 16:38
  • I've not tried single database myself but I expect you should be able to get it working with multiple schemas, potentially you could also get shared database, shared schema to work if you set the Session Context for the User Id when you open the connection as done in the [EF shared db, shared user example](https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-dotnet-entity-framework-row-level-security). – mythz May 12 '17 at 16:45