Community研究&データ分析github.com

Unknown-333/データ取り込みパイプライン構築

フル抽出と差分抽出、変更データキャプチャ(CDC)、ウォーターマークとハイウォーターマーク、APIページネーションとレート制限、マネージドELツール(Fivetran、Airbyte)とカスタムコードの選択など、バッチおよび差分データ取り込み(抽出・ロード)パイプラインを構築します。データベース、API、ファイル、SaaSからウェアハウス/レイクにデータを取り込む際や、差分抽出とCDCを設計する際に使用します。

データ取り込みパイプライン構築 とは?

このスキルは、データエンジニアやAIエージェントがデータ取り込みパイプラインを設計・実装するための包括的なガイドを提供します。データベース、API、ファイル、SaaSアプリケーションなど多様なソースからウェアハウスやデータレイクへのデータ抽出とロードに焦点を当てています。フルスナップショット、差分抽出(ウォーターマークベース)、変更データキャプチャ(CDC)という3つの主要な抽出モードをカバーし、それぞれの適切なユースケースを説明します。また、信頼性の高いハイウォーターマークの選択(updated_at、LSN/binlog、シーケンス番号など)、APIページネーションとレート制限の処理、再試行と遅延データへの対処、べき等性のあるロード戦略(upsertやパーティション上書き)についても詳しく解説します。FivetranやAirbyteのようなマネージドELツールとカスタムコードのどちらを選ぶべきかの判断基準も提供します。このスキルは、Claude Code、Cursor、CodexなどのAIエージェントプラットフォームで使用することを想定しており、生データを不変に保持し(Bronzeレイヤー)、後続の変換処理と切り離すという重要な原則を強調しています。一般的な落とし穴として、信頼性の低いupdated_atウォーターマーク、オーバーラップウィンドウの欠如、差分抽出での削除データの見逃し、抽出中の変換による再実行不能、レート制限の無視、非べき等ロードによる重複などが挙げられています。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/Unknown-333/awesome-data-engineering-skills/tree/main/skills/building-ingestion-pipelines

Installed? Explore more 研究&データ分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

データ取り込みパイプラインの構築

使用する場合

  • データベース、API、ファイル、SaaSからウェアハウス/レイクへの抽出。
  • 差分抽出、ウォーターマーク、またはCDCの設計。
  • APIのページネーション、レート制限、再試行の処理。
  • マネージドEL(Fivetran/Airbyte)とカスタムコードの決定。
  • すでに取り込まれたデータの変換には使用しないでください(dbt/Sparkスキルを使用)。

ワークフロー

- [ ] 抽出モードを決定する:フルスナップショット vs 差分 vs CDC
- [ ] 信頼性の高いハイウォーターマークを選ぶ(updated_at、LSN/binlog、シーケンス)
- [ ] 生データを不変に保存(追記)、後続の変換は下流で行う
- [ ] ロードをべき等にする(キーによるupsert/パーティション上書き)
- [ ] ページネーション、レート制限、再試行、遅延データを処理する
  1. モードを選択する。 フルリロード(小規模/ディメンションテーブル)、ハイウォーターマークによる差分(ほとんどのファクトテーブル)、またはCDC(削除とすべての変更が必要な高ボリュームOLTP)。
  2. 信頼性の高いウォーターマークを選ぶ。 updated_atはソースが常にそれを更新する場合にのみ機能します。それ以外の場合は、DBログ位置(LSN/binlog/SCN)または単調増加シーケンスを使用します。最後のウォーターマークを保存し、そこから再開します。
  3. 生データを不変に保存する。 生の抽出データをロードメタデータとともに追記(Bronze)します。変換は下流で行い、ソースから再取得せずに再実行できるようにします。
  4. べき等ロード。 自然キーでupsertするかパーティションを上書きし、再試行やオーバーラップで重複が発生しないようにします(writing-idempotent-transformationsを参照)。
  5. 堅牢に処理する ページネーション、レート制限、遅延データに対して。

パターン

遅延データ対策のオーバーラップ付き差分抽出:

-- 最後のウォーターマークを過ぎた小さなオーバーラップウィンドウをプルして遅延更新をキャッチし、
-- キーでupsertすることでオーバーラップによる重複を防ぐ。
SELECT * FROM source.orders
WHERE updated_at >= :last_watermark - INTERVAL '3 days';

CDC — データベースログ(Debezium/ネイティブ)を読み取り、挿入、更新、削除(ウォーターマークベースの抽出では見逃される)をキャプチャします。変更のコミット位置を使用して順序付けし、MERGEで変更を適用します。

APIページネーション + レート制限 — カーソル/次ページトークンに従います。429/5xxに対して指数バックオフとジッターでバックオフし再試行します。進捗をチェックポイントとして保存し、障害時に途中から再開できるようにします。

マネージド vs カスタム — 標準コネクタにはFivetran/Airbyteを使用します(スキーマ変更、差分状態、再試行を処理します)。カスタムコードは、特殊なソースや厳格な制御/コスト要件がある場合のみ作成します。

よくある落とし穴

  • ソースが確実に更新しないupdated_atウォーターマーク — 行を静かに見逃します。検証するか、ログベースのCDCに切り替えます。
  • オーバーラップウィンドウがない — 実行間に遅れて到着した更新が失われます。
  • ウォーターマークベースの抽出で削除を期待する — 削除を検出できません。CDCまたは定期的なフルリコンシリエーションを使用します。
  • 抽出中に変換を行う — 再実行が不可能になります。最初に生データを保存します。
  • レート制限/ページネーションのエッジケースを無視する — 完全に見えるが実際は部分的なプルになります。チェックポイントを設定し、カウントを検証します。
  • 非べき等ロード — 再試行とオーバーラップウィンドウにより行が重複します。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

Unknown-333/authoring-airflow-dags

Write production-grade Apache Airflow DAGs using the TaskFlow API — idempotent tasks, correct scheduling and catchup, retries/SLAs, connections/variables, and avoiding top-level code. Use when creating or reviewing Airflow DAGs, scheduling pipelines, wiring task dependencies, configuring retries/backfills, or fixing non-idempotent tasks.

Unknown-333/building-dagster-assets

Build Dagster pipelines using software-defined assets — asset dependencies, partitions, resources and IO managers, asset checks, and schedules/sensors. Use when creating Dagster assets or jobs, modeling data as assets, adding partitions or backfills, wiring resources/IO managers, or migrating from task-based orchestration to assets.

Unknown-333/building-dbt-models

Build well-structured dbt models — staging/intermediate/marts layers, ref() and source(), materializations, and incremental models with the right strategy. Use when creating or refactoring dbt models, choosing table vs view vs incremental, structuring a dbt project, or writing incremental logic.

Unknown-333/building-feature-pipelines

Build ML feature pipelines and feature stores — point-in-time-correct joins to avoid label leakage, offline/online parity, feature freshness and backfills, and materialization with tools like Feast. Use when engineering features for ML, preventing train/serve skew or data leakage, building a feature store, or backfilling historical features for training.

Unknown-333/building-iceberg-tables

Design and operate Apache Iceberg tables — partitioning and hidden partitioning, partition/schema evolution, snapshots and time travel, compaction and small-file cleanup, and MERGE/upsert for lakehouse tables on Spark, Flink, Trino, or Snowflake. Use when creating or maintaining Iceberg tables, choosing partitioning, evolving schema/partitions, or fixing small-file and metadata bloat.

Unknown-333/building-kafka-consumers

Build reliable Apache Kafka consumers and producers — consumer groups and partition assignment, offset commit strategy, at-least-once vs exactly-once, idempotent/transactional producers, rebalancing, and dead-letter handling. Use when writing Kafka consumers/producers, configuring offset commits or consumer groups, tuning throughput, or handling rebalances and poison messages.

Unknown-333/debugging-data-pipelines

Systematically root-cause data pipeline failures and data incidents — job errors, wrong or missing data, duplicates, and freshness misses — by tracing lineage upstream, isolating the failing stage, reconciling against source, and planning a safe fix and backfill. Use when a pipeline fails, numbers look wrong, data is missing or duplicated, a dashboard is stale, or a stakeholder reports a data discrepancy.

Unknown-333/designing-backfills-and-replays

Plan and run safe data backfills and replays — idempotent reprocessing of historical windows, partition-by-partition execution, isolating backfill compute from production, verifying results, and avoiding double-counting or changed history. Use when backfilling a new or fixed model, reprocessing after a bug, replaying events, or loading history for a new pipeline without corrupting existing data.

Unknown-333/designing-data-contracts

Define and enforce data contracts between producers and consumers — explicit schema, semantics, ownership, SLAs, and versioning — to prevent silent upstream changes from breaking downstream pipelines. Use when a producer schema change could break consumers, defining an interface between teams/services and the warehouse, or adding schema enforcement at ingestion.

関連スキル