有关 Azure Synapse Link for Azure Cosmos DB 的常见问题Frequently asked questions about Azure Synapse Link for Azure Cosmos DB

适用于: SQL API Azure Cosmos DB API for MongoDB

Azure Synapse Link for Azure Cosmos DB 在 Azure Cosmos DB 和 Azure Synapse Analytics 之间建立紧密的集成。Azure Synapse Link for Azure Cosmos DB creates a tight integration between Azure Cosmos DB and Azure Synapse Analytics. 它使客户能够通过与事务工作负荷的完全性能隔离且无需 ETL 管道对其操作数据运行准实时分析。It enables customers to run near real-time analytics over their operational data with full performance isolation from their transactional workloads and without an ETL pipeline. 本文解答有关 Synapse Link for Azure Cosmos DB 的常见问题。This article answers commonly asked questions about Synapse Link for Azure Cosmos DB.

常见问题解答General FAQ

Azure Cosmos DB SQL (Core) API 和 Azure Cosmos DB API for MongoDB 支持 Azure Synapse Link。Azure Synapse Link is supported for the Azure Cosmos DB SQL (Core) API and for the Azure Cosmos DB API for MongoDB.

是的,对于多区域 Azure Cosmos 帐户,存储在分析存储中的数据也是多区域分布的。Yes, for multi-region Azure Cosmos accounts, the data stored in the analytical store is also multiple-regionally distributed. 无论是单一写入区域还是多个写入区域,都可以从最近的本地区域提供从 Azure Synapse Analytics 执行的分析查询。Regardless of single write region or multiple write regions, analytical queries performed from Azure Synapse Analytics can be served from the closest local region.

计划配置具有分析存储支持的多区域 Azure Cosmos DB 帐户时,建议在创建帐户时添加所有必要的区域。When planning to configure a multi-region Azure Cosmos DB account with analytical store support, it is recommended to have all the necessary regions added at time of account creation.

为多区域帐户启用 Azure Synapse Link 时,将在所有区域中创建分析存储。When Azure Synapse Link is enabled for a multi-region account, the analytical store is created in all regions. 基础数据针对事务存储中的吞吐量和事务一致性进行了优化。The underlying data is optimized for throughput and transactional consistency in the transactional store.

所有 Azure Cosmos DB 区域中是否都支持分析存储?Is analytical store supported in all Azure Cosmos DB regions?

是的。Yes.

对于启用了分析存储的容器,目前不支持自动备份和还原分析存储中的数据。For the containers with analytical store turned on, automatic backup and restore of your data in the analytical store is not supported at this time.

在数据库帐户上启用 Synapse Link 后,Azure Cosmos DB 会像往常一样,继续按计划的备份间隔以自动方式仅对容器的事务性存储中的数据执行备份When Synapse Link is enabled on a database account, Azure Cosmos DB will continue to automatically take backups of your data in the transactional store (only) of containers at scheduled backup interval, as always. 需要特别注意的是,将启用了分析存储的容器还原到新帐户时,将仅使用事务性存储来还原容器,而不会启用分析存储。It is important to note that when a container with analytical store turned on is restored to a new account, the container will be restored with only transactional store and no analytical store enabled.

目前,在帐户级别启用 Synapse Link 功能后,无法禁用它。Currently, after the Synapse Link capability is enabled at the account level, you cannot disable it. 我们知道,如果在帐户级别启用了 Synapse Link 功能,但没有启用了分析存储的容器,则不会产生任何计费影响。Understand that you will not have any billing implications if the Synapse Link capability is enabled at the account level and there is no analytical store enabled containers.

如果需要关闭该功能,可以选择 2 个选项。If you need to turn off the capability, you have 2 options. 第一个选项是删除并重新创建新的 Azure Cosmos DB 帐户,根据需要迁移数据。The first one is to delete and re-create a new Azure Cosmos DB account, migrating the data if necessary. 第二个选项是打开支持票证,以获取有关将数据迁移到其他帐户的帮助。The second option is to open a support ticket, to get help on a data migration to another account.

分析存储是否对 Cosmos DB 事务性 SLA 有一些影响?Does analytical store have any impact on Cosmos DB transactional SLAs?

否,没有任何影响。No, there is no impact.

Azure Cosmos DB 分析存储Azure Cosmos DB analytical store

我是否可以在现有容器上启用分析存储?Can I enable analytical store on existing containers?

目前,只能为新容器(在新帐户和现有帐户中)启用分析存储。Currently, the analytical store can only be enabled for new containers (both in new and existing accounts).

在容器创建期间启用分析存储后,我是否可以在 Azure Cosmos DB 容器上禁用分析存储?Can I disable analytical store on my Azure Cosmos DB containers after enabling it during container creation?

目前,在容器创建期间启用分析存储后,无法在 Azure Cosmos DB 容器上禁用分析存储。Currently, the analytical store cannot be disabled on an Azure Cosmos DB container after it is enabled during container creation.

具有自动缩放预配吞吐量的 Azure Cosmos DB 容器是否支持分析存储?Is analytical store supported for Azure Cosmos DB containers with autoscale provisioned throughput?

是的,可以在具有自动缩放预配吞吐量的容器上启用分析存储。Yes, the analytical store can be enabled on containers with autoscale provisioned throughput.

是否会影响 Azure Cosmos DB 事务存储预配 RU?Is there any effect on Azure Cosmos DB transactional store provisioned RUs?

Azure Cosmos DB 保证事务和分析工作负荷之间的性能隔离。Azure Cosmos DB guarantees performance isolation between the transactional and analytical workloads. 在容器上启用分析存储不会影响 Azure Cosmos DB 事务存储上预配的 RU/s。Enabling the analytical store on a container will not impact the RU/s provisioned on the Azure Cosmos DB transactional store. 分析存储的事务(读取和写入)和存储成本将单独收费。The transactions (read & write) and storage costs for the analytical store will be charged separately. 有关更多详细信息,请参阅 Azure Cosmos DB 分析存储的定价See the pricing for Azure Cosmos DB analytical store for more details.

能否将客户管理的密钥用于 Azure Cosmos DB 分析存储?Can I use customer-managed keys with the Azure Cosmos DB analytical store?

可以采用自动且透明的方式使用相同的客户管理密钥无缝地跨事务存储和分析存储加密数据。You can seamlessly encrypt the data across transactional and analytical stores using the same customer-managed keys in an automatic and transparent manner. 若要在分析存储中使用客户管理的密钥,需在 Azure Key Vault 访问策略中使用由 Azure Cosmos DB 帐户的系统分配的托管标识。To use customer-managed keys with the analytical store, you need to use your Azure Cosmos DB account's system-assigned managed identity in your Azure Key Vault access policy. 此处对此进行了说明。This is described here. 然后,你应能够在帐户上启用分析存储。You should then be able to enable the analytical store on your account.

对事务存储的删除和更新操作是否反映在分析存储中?Are delete and update operations on the transactional store reflected in the analytical store?

是的,对事务存储中的数据的删除和更新将反映在分析存储中。Yes, deletes and updates to the data in the transactional store will be reflected in the analytical store. 可以在容器上配置生存时间 (TTL) 以包括历史数据,以便分析存储保留满足分析 TTL 条件的项的所有版本。You can configure the Time to Live (TTL) on the container to include historical data so that the analytical store retains all versions of items that satisfy the analytical TTL criteria. 有关更多详细信息,请参阅分析 TTL 概述See the overview of analytical TTL for more details.

我是否可以从 Azure Synapse Analytics 以外的分析引擎连接到分析存储?Can I connect to analytical store from analytics engines other than Azure Synapse Analytics?

只能使用 Azure Synapse Analytics 提供的各种运行时来访问和运行针对分析存储的查询。You can only access and run queries against the analytical store using the various run-times provided by Azure Synapse Analytics. 可以使用以下对象查询和分析分析存储:The analytical store can be queried and analyzed using:

  • 完全支持 Scala、Python、SparkSQL 和 C# 的 Synapse Spark。Synapse Spark with full support for Scala, Python, SparkSQL, and C#. Synapse Spark 是数据工程和科学方案的核心Synapse Spark is central to data engineering and science scenarios
  • 采用 T-SQL 语言且支持熟悉的 BI 工具(例如 Power BI Premium 等)的无服务器 SQL 池Serverless SQL pool with T-SQL language and support for familiar BI tools (For example, Power BI Premium, etc.)

我是否可以从预配的 Synapse SQL 连接到分析存储?Can I connect to analytical store from Synapse SQL provisioned?

目前,无法从预配的 Synapse SQL 访问分析存储。At this time, the analytical store cannot be accessed from Synapse SQL provisioned.

我是否可以将 Synapse 中的查询聚合结果写回到分析存储?Can I write back the query aggregation results from Synapse back to the analytical store?

分析存储是 Azure Cosmos DB 容器中的只读存储。Analytical store is a read-only store in an Azure Cosmos DB container. 因此,无法直接将聚合结果写回到分析存储,但是可以将其写入另一个容器的 Azure Cosmos DB 事务存储,以后可将其用作服务层。So, you cannot directly write back the aggregation results to the analytical store, but can write them to the Azure Cosmos DB transactional store of another container, which can later be leveraged as a serving layer.

从事务存储到分析存储的自动同步复制是异步的还是同步的,以及有哪些延迟?Is the autosync replication from transactional store to the analytical store asynchronous or synchronous and what are the latencies?

自动同步延迟通常在 2 分钟内。Auto-sync latency is usually within 2 minutes. 如果共享吞吐量数据库拥有大量容器,则单个容器的自动同步延迟可能会更高,最长可能达 5 分钟。In cases of shared throughput database with a large number of containers, auto-sync latency of individual containers could be higher and take up to 5 minutes. 我们希望详细了解此延迟如何适应你的场景。We would like to learn more how this latency fits your scenarios. 请联系 Azure Cosmos DB 团队提供相关反馈。For that, please reach out to the Azure Cosmos DB team.

是否有事务存储中的项不会自动传播到分析存储的方案?Are there any scenarios where the items from the transactional store are not automatically propagated to the analytical store?

如果容器中的特定项违反了用于分析的完善定义的架构,则不会将其包含在分析存储中。If specific items in your container violate the well-defined schema for analytics, they will not be included in the analytical store. 如果你的方案被完善定义的用于分析的架构阻止,请向 Azure Cosmos DB 团队发送电子邮件以获取帮助。If you have scenarios blocked by well-defined schema for analytics, email the Azure Cosmos DB team for help.

我是否可以使用与对事务存储中的数据进行分区的不同方式,对分析存储中的数据进行分区?Can I partition the data in analytical store differently from transactional store?

基于事务存储中分片的水平分区,对分析存储中的数据进行分区。The data in analytical store is partitioned based on the horizontal partitioning of shards in the transactional store. 目前,无法为分析存储选择其他分区策略。Currently, you cannot choose a different partitioning strategy for the analytical store.

我是否可以自定义或覆盖在分析存储中将事务数据转换为纵栏格式的方式?Can I customize or override the way transactional data is transformed into columnar format in the analytical store?

目前,当数据项自动从事务存储传播到分析存储时,无法对其进行转换。Currently you can't transform the data items when they are automatically propagated from the transactional store to analytical store. 如果你的方案被此限制阻止,请向 Azure Cosmos DB 团队发送电子邮件。If you have scenarios blocked by this limitation, email the Azure Cosmos DB team.

Terraform 是否支持分析存储?Is analytical store supported by Terraform?

目前 Terraform 不支持分析存储容器。Currently Terraform doesn't support analytical store containers. 有关详细信息,请查看 Terraform GitHub 问题Please check Terraform GitHub Issues for more information.

分析生存时间 (TTL)Analytical Time to live (TTL)

是否在容器和项级别支持分析数据的 TTL?Is TTL for analytical data supported at both container and item level?

目前,分析数据的 TTL 只能在容器级别配置,不支持在项级别设置分析 TTL。At this time, TTL for analytical data can only be configured at container level and there is no support to set analytical TTL at item level.

在 Azure Cosmos DB 容器上设置容器级别分析 TTL 后,我是否可以在以后将其更改为其他值?After setting the container level analytical TTL on an Azure Cosmos DB container, can I change to a different value later?

是的,可以将分析 TTL 更新为任何有效的值。Yes, analytical TTL can be updated to any valid value. 有关分析 TTL 的更多详细信息,请参阅分析 TTL 一文。See the Analytical TTL article for more details about analytical TTL.

某个项在事务存储中超过 TTL 后,我是否可以在分析存储中更新或删除该项?Can I update or delete an item from the analytical store after it has been TTL'd out from the transactional store?

所有事务更新和删除都将复制到分析存储,但如果已从事务存储中清除该项,则无法在分析存储中更新。All transactional updates and deletes are copied to the analytical store but if the item has been purged from the transactional store, then it cannot be updated in the analytical store. 若要了解详细信息,请参阅分析 TTL 一文。To learn more, see the Analytical TTL article.

计费Billing

Azure Synapse Link 的计费模型包括使用 Azure Cosmos DB 分析存储和 Synapse 运行时所产生的成本。The billing model of Azure Synapse Link includes the costs incurred by using the Azure Cosmos DB analytical store and the Synapse runtime. 若要了解详细信息,请参阅 Azure Cosmos DB 分析存储定价文章。To learn more, see the Azure Cosmos DB analytical store pricing articles.

无。None. 仅当创建已启用分析存储的容器并开始加载数据时,才会向你收费。You will only be charged when you create an analytical store enabled container and start to load data.

安全性Security

对分析存储进行身份验证的方式有哪些?What are the ways to authenticate with the analytical store?

对分析存储进行身份验证的方式与对事务存储进行身份验证的方式相同。Authentication with the analytical store is the same as a transactional store. 对于给定的数据库,可以使用主密钥或只读密钥进行身份验证。For a given database, you can authenticate with the primary or read-only key. 可以利用 Azure Synapse Studio 中的链接服务,以避免将 Azure Cosmos DB 密钥粘贴到 Spark 笔记本中。You can leverage linked service in Azure Synapse Studio to prevent pasting the Azure Cosmos DB keys in the Spark notebooks. 有权访问工作区的所有用户都可以访问此链接服务。Access to this Linked Service is available for everyone who has access to the workspace.

Synapse 运行时Synapse run-times

当前支持的用于访问 Azure Cosmos DB 分析存储的 Synapse 运行时有哪些?What are the currently supported Synapse run-times to access Azure Cosmos DB analytical store?

Azure Synapse 运行时Azure Synapse runtime 当前支持Current support
Azure Synapse Spark 池Azure Synapse Spark pools 读取、写入(通过事务存储)、表、临时视图Read, Write (through transactional store), Table, Temporary View
Azure Synapse 无服务器 SQL 池Azure Synapse serverless SQL pool 读取、查看Read, View
Azure Synapse SQL 预配Azure Synapse SQL Provisioned 不可用Not available

Azure Synapse Spark 表与 Azure Synapse 无服务器 SQL 池表同步的方式是否和它们与 Azure Data Lake 同步的方式相同?Do my Azure Synapse Spark tables sync with my Azure Synapse serverless SQL pool tables the same way they do with Azure Data Lake?

目前,此功能不可用。Currently, this feature is not available.

我是否可以从分析存储执行 Spark 结构化流式处理?Can I do Spark structured streaming from analytical store?

目前,对 Azure Cosmos DB 的 Spark 结构化流式处理支持是使用事务存储的更改源功能实现的,并且尚不受分析存储支持。Currently Spark structured streaming support for Azure Cosmos DB is implemented using the change feed functionality of the transactional store and it's not yet supported from analytical store.

是否支持流式处理?Is streaming supported?

我们不支持从分析存储流式处理数据。We do not support streaming of data from the analytical store.

Azure Synapse StudioAzure Synapse Studio

在 Azure Synapse Studio 中,如何识别是否连接到启用了分析存储的 Azure Cosmos DB 容器?In the Azure Synapse Studio, how do I recognize if I'm connected to an Azure Cosmos DB container with the analytics store enabled?

使用分析存储启用的 Azure Cosmos DB 容器具有以下图标:An Azure Cosmos DB container enabled with analytical store has the following icon:

使用分析存储启用的 Azure Cosmos DB 容器 - 图标

事务存储容器将使用以下图标表示:A transactional store container will be represented with the following icon:

使用事务存储启用的 Azure Cosmos DB 容器 - 图标

如何从 Azure Synapse Studio 传递 Azure Cosmos DB 凭据?How do you pass Azure Cosmos DB credentials from Azure Synapse Studio?

目前,Azure Cosmos DB 凭据是由有权访问 Azure Cosmos DB 数据库的用户在创建链接服务时传递的。Currently Azure Cosmos DB credentials are passed while creating the linked service by the user who has access to the Azure Cosmos DB databases. 有权访问工作区的其他用户可以访问该存储。Access to that store is available to other users who have access to the workspace.

后续步骤Next steps