您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

多租户 SaaS 应用简介,该应用通过“每个租户各有数据库”模式使用 SQL 数据库Introduction to a multitenant SaaS app that uses the database-per-tenant pattern with SQL Database

Wingtip SaaS 应用程序是一个示例多租户应用。The Wingtip SaaS application is a sample multitenant app. 该应用使用“每个租户各有数据库”(一种 SaaS 应用程序模式)为多个租户提供服务。The app uses the database-per-tenant SaaS application pattern to service multiple tenants. 该应用使用多个 SaaS 设计及管理模式,展示支持 SaaS 方案的 Azure SQL 数据库功能。The app showcases features of Azure SQL Database that enable SaaS scenarios by using several SaaS design and management patterns. Wingtip SaaS 应用的部署时间不到五分钟,可快速启动并运行。To quickly get up and running, the Wingtip SaaS app deploys in less than five minutes.

WingtipTicketsSaaS-DbPerTenant GitHub 存储库提供了应用程序源代码和管理脚本。Application source code and management scripts are available in the WingtipTicketsSaaS-DbPerTenant GitHub repo. 开始操作前,请先参阅常规指南,了解下载和取消阻止 Wingtip Tickets 管理脚本的步骤。Before you start, see the general guidance for steps to download and unblock the Wingtip Tickets management scripts.

应用程序体系结构Application architecture

Wingtip SaaS 应用使用“每个租户各有数据库”模型。The Wingtip SaaS app uses the database-per-tenant model. 它使用 SQL 弹性池最大程度提高效率。It uses SQL elastic pools to maximize efficiency. 为了预配租户并将其映射到租户数据,需使用目录数据库。For provisioning and mapping tenants to their data, a catalog database is used. 核心 Wingtip SaaS 应用程序使用一个池和三个示例租户,外加目录数据库。The core Wingtip SaaS application uses a pool with three sample tenants, plus the catalog database. 已使用 DNS 别名预配目录和租户服务器。The catalog and tenant servers have been provisioned with DNS aliases. 这些别名用于维持对 Wingtip 应用程序使用的活动资源的引用。These aliases are used to maintain a reference to the active resources used by the Wingtip application. 这些别名已更新以指向灾难恢复教程中的恢复资源。These aliases are updated to point to recovery resources in the disaster recovery tutorials. 完成许多 Wingtip SaaS 教程都会导致在初始部署中使用加载项。Completing many of the Wingtip SaaS tutorials results in add-ons to the initial deployment. 将介绍分析数据库和跨数据库架构管理等加载项。Add-ons such as analytic databases and cross-database schema management are introduced.

Wingtip SaaS 体系结构

学习教程及使用应用时,应关注 SaaS 模式,因为这些模式与数据层相关。As you go through the tutorials and work with the app, focus on the SaaS patterns as they relate to the data tier. 换句话说,请专注于数据层,不要将过多精力放在分析应用本身上。In other words, focus on the data tier, and don't overanalyze the app itself. 了解这些 SaaS 模式的实现方式是在应用程序中实现这些模式的关键。Understanding the implementation of these SaaS patterns is key to implementing these patterns in your applications. 另外,请考虑根据特定业务要求进行任何必要的修改。Also consider any necessary modifications for your specific business requirements.

SQL 数据库 Wingtip SaaS 教程SQL Database Wingtip SaaS tutorials

部署应用后,请浏览基于初始部署制作的以下教程。After you deploy the app, explore the following tutorials that build on the initial deployment. 这些教程探索常见 SaaS 模式,这些模式利用 SQL 数据库、Azure SQL 数据仓库和其他 Azure 服务的内置功能。These tutorials explore common SaaS patterns that take advantage of built-in features of SQL Database, Azure SQL Data Warehouse, and other Azure services. 教程包括 PowerShell 脚本及详细说明。Tutorials include PowerShell scripts with detailed explanations. 这些说明可简化对应用程序中相同 SaaS 管理模式的理解和实现。The explanations simplify understanding and implementation of the same SaaS management patterns in your applications.

教程Tutorial 描述Description
SQL 数据库多租户 SaaS 应用示例指南和提示Guidance and tips for the SQL Database multitenant SaaS app example 下载并运行 PowerShell 脚本,准备应用程序部件。Download and run PowerShell scripts to prepare parts of the application.
部署和浏览 Wingtip SaaS 应用程序Deploy and explore the Wingtip SaaS application 使用 Azure 订阅部署并浏览 Wingtip SaaS 应用程序。Deploy and explore the Wingtip SaaS application with your Azure subscription.
预配和编录租户Provision and catalog tenants 了解应用程序如何使用目录数据库连接到租户,以及目录如何将租户映射到其数据。Learn how the application connects to tenants by using a catalog database, and how the catalog maps tenants to their data.
监视和管理性能Monitor and manage performance 了解如何使用 SQL 数据库的监视功能,以及如何设置在超出性能阈值时发出警报。Learn how to use monitoring features of SQL Database and set alerts when performance thresholds are exceeded.
使用 Azure Monitor 日志进行监视Monitor with Azure Monitor logs 了解如何使用Azure Monitor 日志跨多个池监视大量资源。Learn how to use Azure Monitor logs to monitor large amounts of resources across multiple pools.
还原单个租户Restore a single tenant 了解如何将租户数据库还原到先前的时间点。Learn how to restore a tenant database to a prior point in time. 此外,请了解如何还原到并行数据库,这会使现有租户数据库保持联机。Also learn how to restore to a parallel database, which leaves the existing tenant database online.
管理租户数据库架构Manage tenant database schema 了解如何跨所有租户数据库更新架构和更新参考数据。Learn how to update schema and update reference data across all tenant databases.
运行跨租户分布式查询Run cross-tenant distributed queries 创建即席分析数据库,并跨所有租户运行实时分布式的查询。Create an ad hoc analytics database, and run real-time distributed queries across all tenants.
对提取的租户数据运行分析Run analytics on extracted tenant data 将租户数据提取到分析数据库或数据仓库,以运行脱机分析查询。Extract tenant data into an analytics database or data warehouse for offline analytics queries.

后续步骤Next steps