← All Learning Paths

Batch Processing Developer

Turn nightly jobs into engineering: micro-batching, claim-check payloads, streaming transforms, bulk upserts, and backfills that never lock the hot table.

roleintermediate9 nodes12.75h total

Path overview

批处理不是写个循环跑一晚上,而是吞吐、内存与锁的三方平衡。本路径从批与流的边界讲起,经微批与管道过滤器模式,落地三篇 PostgreSQL 批量操作文章与三种语言的流式转换实现,收尾于大表回填工作流与聚合练习。

Batch is not a loop that runs overnight; it is a three-way balance of throughput, memory, and locks. This path covers batch versus stream boundaries, micro-batching, pipes-and-filters, bulk SQL, and safe backfills.

  1. Reconstruct the reasoning behind "How to Batch and Coalesce HTTP Requests" by tracing "Measure the duplication first" to the failure it prevents in batch systems.

    Completion criteria: Attach a one-page summary that quotes "Measure the duplication first", lists two trade-offs, and links the commit where you applied it.

    Next step: How to Batch Upsert Rows in PostgreSQL

    ⏱ 1h

  2. Read "How to Batch Upsert Rows in PostgreSQL" for the "The conflict target is business identity" argument, then name the decision in batch work it would change.

    Prerequisites: How to Batch and Coalesce HTTP Requests

    Completion criteria: Attach a decision log for "How to Batch Upsert Rows in PostgreSQL": the "The conflict target is business identity" section, one rejected alternative, and the diff of the file you changed.

    Next step: How to Bulk Import Data into PostgreSQL

    ⏱ 1h

  3. Compare "COPY versus batched inserts" with "Stage, validate, promote" in "How to Bulk Import Data into PostgreSQL" and state which trade-off you would accept in batch code.

    Prerequisites: How to Batch Upsert Rows in PostgreSQL

    Completion criteria: Record a short walkthrough of "How to Bulk Import Data into PostgreSQL" with timestamps at "COPY versus batched inserts" and "Stage, validate, promote", plus the commit that applies it.

    Next step: Node Stream Transform Chunk Pipeline

    ⏱ 1h

  4. Execute "Node Stream Transform Chunk Pipeline", change one constant, and describe how the output diverges from "Chain readable, transform, and writable streams with pipeline to process large files in".

    Prerequisites: How to Bulk Import Data into PostgreSQL

    Completion criteria: Paste the command, the exit code, and the output line matching "Chain readable, transform, and writable streams with pipeline to process large files in"; then show a second run with a changed parameter.

    Next step: Bufio Scanner Streaming NDJSON

    ⏱ 0.75h

  5. Run the batch snippet "Bufio Scanner Streaming NDJSON", capture stdout, and show which line demonstrates the documented behavior: "Parse newline-delimited JSON streams with bufio.Scanner, sizing buffers for long lines and".

    Prerequisites: Node Stream Transform Chunk Pipeline

    Completion criteria: Save two runs of "Bufio Scanner Streaming NDJSON" side by side — the original input and one changed value — and annotate the line where the output diverges.

    Next step: Process CSV Rows Without Loading Everything

    ⏱ 0.75h

  6. Adapt "Process CSV Rows Without Loading Everything" to a second input and compare the new output with the behavior described in "Stream CSV rows with the csv module, validate required headers, convert typed fields, and".

    Prerequisites: Bufio Scanner Streaming NDJSON

    Completion criteria: Change one constant in "Process CSV Rows Without Loading Everything", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Backfill a Large Table Safely

    ⏱ 0.75h

  7. Use "Backfill a Large Table Safely" to decide "The backfill plan has a realistic duration and load estimate.", then prove the outcome with "Populate a new column or table for existing rows without blocking production traffic or".

    Prerequisites: Process CSV Rows Without Loading Everything

    Completion criteria: Deliver a transcript of "Backfill a Large Table Safely" with each step's command and observed state, ending at "Populate a new column or table for existing rows without blocking production traffic or".

    Next step: Aggregate CSV Rows by Category

    ⏱ 1h

  8. Solve "Aggregate CSV Rows by Category": turn A list of (category, total) tuples sorted by total descending, then category ascending. into [('books', 12.5), ('food', 12.0)] and pass the provided samples.

    Prerequisites: Backfill a Large Table Safely

    Completion criteria: Attach the solution file, two passing sample runs, and one failing run whose error matches the contract for "[('books', 12.5), ('food', 12.0)]".

    Next step: Capstone: Batch Processing Developer

    ⏱ 0.5h

  9. Build "Build an Asynchronous Data Export Service" through its phases, keeping "Export job" independently testable.

    Prerequisites: Aggregate CSV Rows by Category

    Completion criteria: Run the project's test command for "Build an Asynchronous Data Export Service", paste the passing output, and attach the acceptance note for "Export job" with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h