Skip to content
Roadmap0/111
not startedstudy day 1 of 6 · covers original day 55

Implement background jobs for ingestion or long-running agent…

P2 RAG platformP3 Agent systemS0C3
not started0/5 blocks
0/5
Jump & context

Week 8: Background Jobs, SSRF, Economic Abuse, Advanced Privacy (DP/MI) & Telemetry

The five hours

  1. 01

    Concepts & system design

    60 min

    R01 — FastAPI background tasks vs. worker queues

    R09 — PostgreSQL transactional job state

    Read the assigned sections; map the mechanism, threat model and trade-offs.

  2. 02

    Project implementation

    120 min

    Implement durable background jobs for P2 document ingestion and P3 long-running workflows. Add idempotency keys, bounded retries, dead-letter queue (DLQ) state, schema-drift validation hooks (C3), and job-ownership checks.

    Build, integrate, debug and improve the increment in the active project.

  3. 03

    Security lab

    60 min

    Replay duplicate job messages and attempt cross-tenant job status polling/cancellation.

    Test the abuse case, failure path, authorization bypass or resource limit.

  4. 04

    Verification & evidence

    30 min

    Idempotency and job-ownership test suite + DLQ recovery test.

    Add or run regression tests; record the 9-point evidence record.

  5. 05

    Deliberate practice & Socratic review

    30 min

    Answer the 8 Socratic questions without notes: What? Why? How? What if? Why not? How can I prove it? Where can it break? What have I learned?

    Re-explain the hardest concept aloud, inspect one edge case, update the gap log.

  6. total5 h

Read today · inside the concepts block

R01 R09

Read only the named sections needed for today's task. Reading sits inside the 60-minute concepts block; it is not extra time.

Free resources for this day

5 curated
  • docsFastAPI (official docs)
    Background Tasks

    Shows FastAPI's in-process BackgroundTasks hook, its dependency-injection form, and the explicit caveat that the work is not durable — the baseline you must leave behind for P2 ingestion jobs.

    R01moved 2026-11-11
  • docsPostgreSQL (official docs)
    PostgreSQL: Documentation: 18: 13.3. Explicit Locking

    Covers advisory locks and transaction-scoped locks, the primitive for job-ownership checks and single-writer claims so two workers cannot process the same ingestion job.

    R09checked 2026-11-11
  • videoSsali Jonathan · 43 min
    Background Tasks with FastAPI Background Tasks and Celery + Redis - FastAPI Beyond CRUD (Part 20)

    Builds the Celery + Redis worker path end to end, including broker configuration, worker startup, and Flower monitoring for retry/DLQ visibility.

    R01checked 2026-11-11
  • videoFANATICUS
    Background tasks in Python : ARQ VS Celery

    Compares ARQ and Celery for FastAPI workers and explains retry configuration and deployment differences that decide how bounded-retry and DLQ behaviour is implemented.

    R01checked 2026-11-11
  • articlemicroservices.io (Chris Richardson)
    Pattern: Transactional outbox

    Explains why an enqueue and a database write must share one transaction, and why the relay only gives at-least-once delivery — forcing idempotency keys and duplicate-safe job handlers.

    R09checked 2026-11-11

Evidence record · 9-point standard

0/9

A lab is complete only when it produces evidence. Installing PyRIT, Garak, Presidio or TransformerLens is not completion. Saved on this device only.

Day notes

empty

The two source formulations

verbatim · nothing summarised

Project & Stage Target

P2 & P3 (C3) | S0

Core Implementation

Implement durable background jobs for P2 document ingestion and P3 long-running workflows. Add idempotency keys, bounded retries, dead-letter queue (DLQ) state, schema-drift validation hooks (C3), and job-ownership checks.

Security Lab

Replay duplicate job messages and attempt cross-tenant job status polling/cancellation.

Verification & Evidence

Idempotency and job-ownership test suite + DLQ recovery test.

Read Today (60m Concepts Block)

R01 (FastAPI background tasks vs. worker queues), R09 (PostgreSQL transactional job state).

---