トリガー パイプライン モードと連続パイプライン モード
Triggered and continuous pipeline modes control how a pipeline processes data: triggered mode refreshes available data and stops, while continuous mode keeps tables fresh as new data arrives. For workloads that require millisecond latency, see Use real-time mode in Lakeflow pipelines.
Pipeline mode is independent of the type of table being computed. Both materialized views and streaming tables can be updated in either pipeline mode.
Refresh operations for standalone materialized views and streaming tables always run using triggered pipeline mode.
Triggerパイプラインモードとは何ですか?
パイプラインで Trigger モードが使用されている場合、システムは更新の起動時に使用可能なデータに基づいてすべてのテーブルを更新した後に停止します。
連続パイプラインモードとは何ですか?
If the pipeline uses continuous execution, it processes new data as it arrives in data sources to keep tables throughout the pipeline fresh.
連続実行モードでの不要な処理を回避するため、パイプラインは依存するDeltaテーブルを自動的に監視し、それらの依存テーブルの内容が変更された場合にのみ更新を実行します。
Choose a data pipeline mode
次の表は、トリガー パイプライン モードと連続パイプライン モードの違いを示しています。
重要な質問 | トリガー | 連続 |
|---|---|---|
アップデートはいつ停止しますか? | Automatically when complete. | 手動で停止されるまで継続して実行されます。 |
What data is processed? | 更新の起動時に利用可能なデータ。 | 構成されたソースに到着するすべてのデータ。 |
どのようなデータの鮮度要件に最適ですか? | データの更新は 10 分ごと、毎時、または毎日実行されます。 | Data updates are desired between every 10 seconds and a few minutes. |
Triggered pipelines can reduce resource consumption and expense because the cluster runs only long enough to update the pipeline. However, new data is not processed until the pipeline is triggered. Continuous pipelines require an always-running cluster, which is more expensive but reduces processing latency.
連続ジョブを使用して連続パイプラインをランする
Databricks では、 パイプライン モード の値を継続的に設定するのではなく、 継続的ジョブ を使用して継続的パイプラインを実行することを推奨しています。継続的ジョブがパイプラインをオーケストレーションする場合、ジョブはパイプラインの実行ライフサイクルを管理し、パイプラインの組み込みの継続的モードではサポートされていない、Standard モードなどのServerless パフォーマンス モード を有効にします。
Job orchestration controls the execution mode only for Lakeflow pipelines. Standalone materialized views and streaming tables always run in triggered mode, regardless of job orchestration.
ジョブがパイプラインをオーケストレーションする場合、ジョブが実行モードを決定し、パイプラインの パイプライン モード 設定よりも優先されます。継続的ジョブは、パイプラインの パイプライン モード がTriggerに設定されていてもパイプラインを継続的に実行します。また、Triggerまたはスケジュールされたジョブは、パイプラインの パイプライン モード が継続的に設定されていても、パイプラインを単一の更新として実行します。
ジョブはパイプライン モード設定を上書きするため、パイプラインを継続的ジョブにラップする場合は、パイプラインの パイプライン モード をTrigger(default)に設定してください。これにより、パイプラインがジョブの外部で実行された場合に予期しない動作が発生するのを防ぐことができます。
パイプラインの連続ジョブを構成する方法については、連続ジョブを使用してパイプラインを継続的に実行するを参照してください。
Run a pipeline with the built-in continuous mode
パイプラインの組み込みの継続的設定は削除されませんが、Databricks では、新しいパイプラインに対しては継続的ジョブ パターンを使用することを推奨しており、組み込み設定の使用は推奨していません。Triggerと継続的を切り替えるには、パイプラインの作成または編集中に、パイプライン設定の パイプライン モード オプションを使用します。「パイプラインの構成」を参照してください。
連続パイプラインのTrigger間隔を設定する
パイプラインを連続モード用に構成する際、Trigger間隔を設定して、パイプラインが各フローの更新を起動する頻度を制御できます。トリガー間隔は、パイプラインが独自の パイプライン モード 設定を通じて継続的モードで実行されるか、継続的ジョブを通じて実行されるかに関係なく適用されるパイプライン構成です。
You can use pipelines.trigger.interval to control the trigger interval for a flow updating a table or an entire pipeline. Because a triggered pipeline processes each table a single time, the pipelines.trigger.interval is used only with continuous pipelines. Databricks recommends setting it on individual tables, because streaming and batch queries have different defaults. Set the value on a pipeline only when processing requires controlling updates for the entire pipeline graph.
フロータイプ別の default 値、および SQL、Python、パイプライン設定での pipelines.trigger.interval の設定例については、パイプラインのTrigger間隔を参照してください。