multi-tenant

Creating a multi-tenant application using PostgreSQL's schemas and Rails

Stuff I've already figured out I'm learning how to create a multi-tenant application in Rails that serves data from different schemas based on what domain or subdomain is used to view the application. I already have a few concerns answered: How can you get subdomain-fu to work with domains as well? Here's someone that asked the same ...

Pass tenant id via sql server connection

Hi guys, I'm building multi tenant application with shared table structure using Microsoft SQL Server. I wonder if it possible to pass tenantID parameter via sql server connection. I don't want to create separate user account for each tenant. Currently I see two ways: via ApplicationName or WorkstationID Best regards, Alexey Zakharov...

Multi tenant membership provider ASP.NET MVC

Hello, I'm building a multi-tenant app with ASP.NET MVC and have a problem with validating users. Situation I have: -a table with User(ID, Name, FirstName, Email) This table is made, so that a users who is registered in two tenants doesn't need to login again. -a table with Tentantuser(ID, TenantID, UserID (FK to table User), User...

using a Singleton to pass credentials in a multi-tenant application a code smell?

I'm currently working on a multi-tenant application that employs Shared DB/Shared Schema approach. IOW, we enforce tenant data segregation by defining a TenantID column on all tables. By convention, all SQL reads/writes must include a Where TenantID = '?' clause. Not an ideal solution, but hindsight is 20/20. Anyway, since virtually e...

How update in a Multi Tenant app all schema of all tenants?

I am development a app multi tenant. I chose the approach Shared Database/ Separeted Schema. My idea is has a schema default (dbo) and when deploy this schema, do update schema of outhers tenants (tanantA, tenantB, tenantC). In other words, make sincronization schemas. How can sincronized this schemas of tenants with schema default? ...

MultiTenant versus Multiple DBs

I am developing a custom CRM solution which will be sold via the Web/SaaS model. I anticipate tens or hundreds of clients using this solution. I will be using MS SQL as the db engine. Option 1 is to have a single DB, and include a TenantId column on tables, a suitable index and use 'where tenantId={...}' on each db access. Option 2...

Can SSRS support multi-tenant usage?

I have a webforms application built on top of the standard microsoft stack - asp.net, sqlserver2008, ssis, ssrs. In certain cases I would like to run this entire stack in a multi-tenant type mode such that users of one 'slice' would not have any visibility to others. We've solved this on the webapp and ssis side, but not yet with Sql S...

NHibernate ISession specific event listener

Hi, I'm creating a multi-tenant ASP.NET application using NHibernate (shared schema). I had intended to use NHibernates Event Listeners to inspect/modify entities prior to saving to ensure that the current tenants ID was being saved against the entity. The authentication token containing the tenant ID is managed higher up and passed do...

Use single or mulitple mysql users for SaaS PHP/mysql application with multi-tenant architecture

We are building a multiuser app that has one database per customer. All customer database structures are identical. Right now we are generating a new mysql user (per client) that only has privileges to work on its own database. e.g. mysql user1 has rights on dbase1.* (database1.alltables), mysql user2 has rights on dbase2.*. We are no...

What is the best implementation for changing the database schema at runtime using Entity Framework 4?

We are building an ASP.Net MVC 2 multi-tenant application on SQL Server using the "single database, separate schema" model discussed, among other places, here and here, where each tenant has one or more users and is split out with its own, tenant specific, SQL Server schema. The application is using Entity Framework 4. In order for u...

How to serve multiple domains with a single ASP.NET MVC application?

How to implement a mechanism (within a single ASP.NET MVC application) to ensure that: if request comes on mydomain (user visits mydomain.com) -> handle using certain set of controllers if request comes on otherdomain (user visits otherdomain.com) -> handle using different set of controllers (the domains are aliased to the same web h...

In Multi-Tenant Data Architecture, what is the best way to implement tenant filter view?

I am implementing a SaaS application using ASP.Net MVC 2 and SQL Server database. I am using Shared Tenancy approach. To filter data, so far I have found 2 approaches. Option 1: http://msdn.microsoft.com/en-us/library/aa479086.aspx#mlttntda_tvf Using sql login per tenant. Thus, using SUSER_SID() as a filter in the views Option 2: ht...

Best data model for a multi-tenant, multi-language application in .NET with SQL 2008

I am developing a multi-tenant application in .NET with SQL 2008. Each tenant can specify their own language. For instance, a Chinese company may use my application and want all of their data sorted and searchable via Chinese characters. And a German company may use my application and want all of their data sorted and searchable via G...

Multi-tenant User Model

In a multitenant system that hosts multiple organizations and applications, where an organization may use several applications hosted on the system, should my user and role model be such that a single user or role can exist across multiple applications and organizations? Or should I limit a user entity to a single organization/applicatio...

IIS 7: Redirecting from non existing subdomains to a subfolder

I'm working on an ASP.NET MVC Multi Tenancy app. Right now I managed to create dynamic subfolders, for instance some one registers with username "bob" and gets the following website: domain.com/bob My next goal is to provide subdomains: bob.domain.com instead of subfolders. I found out that it's very complex to create dynamic subdoma...

How to maintain session attributes in a multitenant architecture?

In case of SaaS applications, where the same server plays host to multiple applications. How are session attributes maintained? To elaborate the question: AppA, and AppB are hosted on the same machine, I now create UserA for AppA and UserB for AppB. AppA and AppB belong to different organizations so they are not linked. Some details abou...

SQL Server cross database query when the other DB name is not known in advance?

Given a multi-tenant setup with one database that holds the tenant data, and one database for each tenant, how can you construct a query to look up the same piece of data in each tenant database? eg The tenant master database has a table called Tenants: [TenantMaster].[dbo].[Tenants] Id, Name, DatabaseName 1, Bob, bobs_db_name 2, Kate,...

Best way to handle multitenancy in Rails 3

Hi guys, I'm building multi-tenant application. All data isolation is done by TenantID column in each table. What is the best way to automatically handle multi-tenancy for all tenant models. Example: Contacts.new({.....}) should automatically add :tenant => curret_user.tenant Contacts.where({....}) should also add :tenant => curret_...

Isolation in a Multi-tenant ASP .NET Application

I'm building a multi-tenant ASP .NET application. Given that each tenant can configure their application dynamically (which may involve dynamic custom assemblies being loaded into memory), I need a means of isolating each tenant. I'd prefer not to create a new Web Application per tenant for maintenance reasons. I've was considering us...