Question

Im setting up a multi tenant database and came across the following blog post on federations: SQL Azure Multi Tenant

They write about assigning a predicate to filter data between tenants:

In a single-tenant app, the query logic in application is coded with the assumption that all data in a database belongs to one tenant. With multi-tenant apps that work with identical schemas, refactored code simply injects tenant_id into the schema (tables, indexes etc) and every query the app issues, contains the tenant_id=? predicate. In a federation, where tenant_id is the federation key, you are asked to still implement the schema changes. However federations provide a connection type called a FILTERING connection that automatically injects this tenant_id predicate without requiring app refactoring. Our data-dependent routing sets up a FILTERING connection by default. Here is how;

1: USE FEDERATION orders_federation(tenant_id=155) WITH RESET, FILTERING=ON

My question is, is this just a SQL azure thing? Or can this be accomplished with any sql server instance?

Thanks in advance

Was it helpful?

Solution

Federations are available only on SQL Azure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top