Community研究與資料分析github.com

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.

designing-backfills-and-replays 是什麼?

designing-backfills-and-replays is a Claude Code agent skill that 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.

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Unknown-333/awesome-data-engineering-skills/tree/main/skills/designing-backfills-and-replays

Installed? Explore more 研究與資料分析 skills: obra/superpowers, affaan-m/quarkus-verification, affaan-m/uspto-database · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Designing Backfills and Replays

When to use

  • Loading history for a new model/pipeline.
  • Reprocessing past windows after fixing a transformation bug.
  • Replaying events or re-deriving a table from raw.
  • Do NOT use for normal incremental runs (use building-dbt-models / authoring-airflow-dags).

Why it deserves care

Backfills are the most dangerous routine operation in data engineering: they rewrite history. Done wrong, they double-count, change yesterday's numbers, or overload production. Done right, they are boring and repeatable. The prerequisite is idempotency (see writing-idempotent-transformations).

Workflow

- [ ] Confirm the transform is idempotent (rerun == run once) BEFORE backfilling
- [ ] Define the exact window and partition granularity
- [ ] Dry-run one partition; verify counts/sums vs source
- [ ] Run partition-by-partition (bounded parallelism), not all at once
- [ ] Isolate backfill compute from production workloads
- [ ] Verify totals and reconcile; then resume normal scheduling
  1. Prove idempotency first. If re-running a window can change results, fix that before touching history. Backfilling a non-idempotent job multiplies data.
  2. Scope precisely. Exact start/end and the partition unit (day/hour/region).
  3. Dry-run one partition and reconcile against source before scaling out.
  4. Chunk the run. Process partitions in bounded batches so you can monitor, pause, and resume — never one giant unbounded job.
  5. Isolate compute. Use a separate warehouse/cluster/pool so the backfill doesn't starve production SLAs.
  6. Verify + resume. Reconcile totals over the backfilled range, then hand back to the normal schedule.

Patterns

Idempotent per-partition backfill — each partition overwrite is independent and safe to retry:

# Bounded parallelism, one day at a time; each day overwrites its own partition.
for day in $(seq_dates 2026-01-01 2026-01-31); do
  run_transform --run-date "$day"   # delete-insert / MERGE for that day only
done

Airflowcatchup/backfill reruns intervals; only safe when tasks are idempotent and parameterized by the data interval. dbt — filter the incremental model to the target window, or --full-refresh a bounded window.

Isolate + throttle — dedicated warehouse/cluster and a concurrency cap so the backfill can't degrade live dashboards.

Common pitfalls

  • Backfilling a non-idempotent job — duplicates or shifting totals; make it idempotent first.
  • One giant unbounded run — can't monitor or resume, and it overloads production; go partition-by-partition.
  • Sharing production compute — backfills spike load and blow SLAs; isolate.
  • No verification — assuming success; reconcile counts/sums over the range.
  • Changing logic mid-backfill — inconsistent history; pin the code version for the whole run.
  • Forgetting downstream — backfilling a base table without refreshing dependent marts/aggregates leaves them inconsistent.

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-ingestion-pipelines

Build batch and incremental data ingestion (extract-load) pipelines — full vs incremental extraction, change data capture (CDC), watermarks and high-water marks, API pagination and rate limits, and choosing managed EL tools (Fivetran, Airbyte) vs custom code. Use when ingesting data from databases, APIs, files, or SaaS into a warehouse/lake, or designing incremental extraction and CDC.

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-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.

相關技能