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

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 支持 Synapse Link。In the public preview release, 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 (single master) or multiple write regions (also known as multi-master), analytical queries performed from Azure Synapse Analytics can be served from the closest local region.

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

在预览版中,为多区域帐户启用 Synapse Link 时,将在所有区域中创建分析存储。In the preview release, when 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.

预览版中,对于启用了 Synapse Link 的数据库帐户,不支持备份和还原容器。In preview, for Synapse Link enabled database accounts, backup and restore of containers is not supported. 如果具有需要备份和还原功能的生产工作负荷,我们建议不要在这些数据库帐户上启用 Synapse Link。If you have production workloads that require backup and restore functionality, we recommended not to enable Synapse Link on those database accounts.

目前,在帐户级别启用 Synapse Link 功能后,无法禁用它。Currently, after the Synapse Link capability is enabled at the account level, you cannot disable it. 如果要关闭该功能,则必须删除并重新创建新的 Azure Cosmos 帐户。If you want to turn off the capability, you have to delete and re-create a new Azure Cosmos account.

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

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 容器上禁用分析存储?Can I disable analytical store on my Azure Cosmos containers after enabling it during container creation?

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

具有自动缩放预配吞吐量的 Azure Cosmos 容器是否支持分析存储?Is analytical store supported for Azure Cosmos 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.

对事务存储的删除和更新操作是否反映在分析存储中?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 无服务器SQL serverless 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 容器中的只读存储。Analytical store is a read-only store in an Azure Cosmos 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.

分析生存时间 (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 Cosmos DB 分析存储目前以公共预览版提供,在 2020 年 8 月 30 日之前,不会对分析存储收费。Azure Cosmos DB analytical store is available in public preview without any charges for analytical store until August 30, 2020. Synapse Spark 和 Synapse SQL 通过 Synapse 服务消耗进行计费。Synapse Spark and Synapse SQL are billed through Synapse service consumption.

安全性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 master or read-only key. 可以利用 Synapse Studio 中的链接服务,以防止粘贴 Spark 笔记本中的 Azure Cosmos DB 密钥。You can leverage linked service in 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?

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

Synapse Spark 表和 Synapse SQL 无服务器表同步的方式是否与它和 Azure Data Lake 同步的方式相同?Do my Synapse Spark tables sync with my Synapse SQL serverless 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.

Synapse StudioSynapse Studio

在 Synapse Studio 中,如何识别是否连接到启用了分析存储的 Azure Cosmos DB 容器?In the 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 容器 - 图标

如何从 Synapse Studio 传递 Azure Cosmos DB 凭据?How do you pass Azure Cosmos DB credentials from 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