流式引入策略Streaming ingestion policy

流式引入目标方案Streaming ingestion target scenario

流式引入适用于需要低延迟且各种量级数据的引入时间小于 10 秒的方案。Streaming ingestion is targeted for scenarios that require low latency, with an ingestion time of less than 10 seconds for varied volume data. 它用于优化一个或多个数据库中多个表的操作处理,其中进入每个表的数据流相对较小(每秒几条记录),但总体数据引入量较高(每秒成千上万条记录)。It's used to optimize operational processing of many tables, in one or more databases, where the stream of data into each table is relatively small (a few records per second) but the overall data ingestion volume is high (thousands of records per second).

当每张表的数据量增加到每小时 4 Gb 以上时,请使用经典(批量)引入而不是流式引入。Use the classic (bulk) ingestion instead of streaming ingestion when the amount of data grows to more than 4 Gb per hour per table.

流式引入策略定义Streaming ingestion policy definition

流式引入策略包含以下属性:The streaming ingestion policy contains the following properties:

  • IsEnabledIsEnabled:
    • 定义表/数据库的流式引入功能的状态defines the status of streaming ingestion functionality for the table/database
    • 必需,无默认值,必须显式设置为“true”或“false”mandatory, no default value, must explicitly be set to true or false
  • HintAllocatedRateHintAllocatedRate:
    • 如果设置,则为表预期的每小时数据量(以 GB 为单位)提供提示。if set provides a hint on the hourly volume of data in gigabytes expected for the table. 此提示有助于系统调整分配给表的资源量,以支持流式引入。This hint helps the system adjust the amount of resources that are allocated for a table in support of streaming ingestion.
    • 默认值“NULL”(取消设置)default value null (unset)

若要对表启用流式引入,请定义流式引入策略,将“IsEnabled”设置为“true”。To enable streaming ingestion on a table, define the streaming ingestion policy with IsEnabled set to true. 可以在表本身或数据库上设置此定义。This definition can be set on a table itself or on the database. 在数据库级别定义此策略将对数据库中的所有现有表和未来表应用相同的设置。Defining this policy at the database level applies the same settings to all existing and future tables in the database. 如果同时在表级别和数据库级别设置流式引入策略,则表级别设置优先。If the streaming ingestion policy is set at both the table and database levels, the table level setting takes precedence. 此设置意味着通常可以为数据库启用流式引入,但可以专门对某些表禁用流式引入,反之亦然。This setting means that streaming ingestion can be generally enabled for the database but specifically disabled for certain tables, or the other way around.

备注

如果表不直接获得流式引入,而只是通过更新策略获得,则不必在此表上定义流式引入策略。If a table doesn't get streaming ingestion directly, but only via an update policy, no streaming ingestion policy has to be defined on this table.

设置数据速率提示Set the data rate hint

流式引入策略可以提供有关表预期的每小时数据量的提示。The streaming ingestion policy can provide a hint about the hourly volume of data expected for the table. 此提示有助于系统调整分配给该表的资源量,以支持流式引入。This hint will help the system adjust the amount of resources allocated for this table in support of streaming ingestion. 如果将数据流式引入表的速度超过 1 Gb/小时,则设置此提示。Set the hint if the rate of streaming data ingress into the table will exceed 1 Gb/hour. 如果在数据库的流式引入策略中设置“HintAllocatedRate”,则按预期数据速率最高的表设置此项。If setting HintAllocatedRate in the streaming ingestion policy for the database, set it by the table with the highest expected data rate. 建议不要将表的有效提示设置为远高于预期的每小时数据速率峰值的值。It isn't recommended to set the effective hint for a table to a value much higher than the expected peak hourly data rate. 此设置可能会对查询性能产生不利影响。This setting may have an adverse effect on the query performance.