Multitenancy and Azure SQL Database
Multitenant solutions on Azure commonly use Azure SQL Database. On this page, we describe some of the features of Azure SQL Database that are useful when you design a multitenant system. We also link to guidance and examples for how to use Azure SQL in a multitenant solution.
Guidance
The Azure SQL Database team publishes extensive guidance on implementing multitenant architectures with Azure SQL Database. See Multitenant SaaS patterns with Azure SQL Database. Also, consider the guidance for partitioning Azure SQL databases.
Features of Azure SQL Database that support multitenancy
Azure SQL Database includes many features that support multitenancy.
Elastic pools
Elastic pools enable you to share compute resources between many databases on the same server. By using elastic pools, you can achieve performance elasticity for each database, while also achieving cost efficiency by sharing your provisioned resources across databases. Elastic pools provide built-in protections against the Noisy Neighbor problem.
More information:
- SQL Database elastic pools
- Resource management in dense elastic pools
- Disaster recovery strategies for applications using SQL Database elastic pools
Elastic database tools
The Sharding pattern enables you to scale your workload across multiple databases. Azure SQL Database provides tools to support sharding. These tools include the management of shard maps (a database that tracks the tenants assigned to each shard). THey also include initiating and tracking queries and management operations on multiple shards by using elastic jobs.
More information:
- Multitenant applications with elastic database tools and row-level security
- Scaling out with Azure SQL Database
- Elastic database jobs
- The Elastic Jobs tutorial describes the process of creating, configuring, and managing elastic jobs.
Row-level security
Row-level security is useful for enforcing tenant-level isolation, when you use shared tables.
More information:
- Video overview
- Documentation
- Multitenant applications with elastic database tools and row-level security
Key management
The Always Encrypted feature provides the end-to-end encryption of your databases. If your tenants require they supply their own encryption keys, consider deploying separate databases for each tenant and consider enabling the Always Encrypted feature.
More information:
Contributors
This article is maintained by Microsoft. It was originally written by the following contributors.
Principal author:
- Paul Burpo | Principal Customer Engineer, FastTrack for Azure
- John Downs | Principal Software Engineer
Other contributors:
- Silvano Coriani | Principal Program Manager, Azure SQL
- Dimitri Furman | Principal Program Manager, Azure SQL
- Sanjay Mishra | Principal Group Program Manager, Azure SQL
- Arsen Vladimirskiy | Principal Customer Engineer, FastTrack for Azure
To see non-public LinkedIn profiles, sign in to LinkedIn.
Next steps
Review storage and data approaches for multitenancy.
Related resources
- Data partitioning strategies for Azure SQL Database
- Case study: Running 1M databases on Azure SQL for a large SaaS provider: Microsoft Dynamics 365 and Power Platform
- Sample: The Wingtip Tickets SaaS application provides three multitenant examples of the same app; each explores a different database tenancy pattern on Azure SQL Database. The first uses a standalone application, per tenant with its own database. The second uses a multitenant app with a database, per tenant. The third sample uses a multitenant app with sharded multitenant databases.
- Video: Multitenant design patterns for SaaS applications on Azure SQL Database