FastAPI Textbook Ch. 7 — Async, Concurrency, and the Threadpool

Concurrency in FastAPI: async vs sync handlers, the threadpool, AnyIO, blocking traps, structured concurrency, and how to scale.

May 6, 2026 · 5 min · 1033 words · Manvendra Rajpoot

Integration Cheatsheet 08 — Testing the Full Stack

Cheatsheet: pytest setup, AsyncClient, real Postgres via testcontainers, factories, drift, migrations.

May 16, 2026 · 3 min · 551 words · Manvendra Rajpoot

FastAPI Cheatsheet 08 — Background Tasks and Job Queues

Cheatsheet: BackgroundTasks for fire-and-forget, ARQ / Celery / Dramatiq enqueue patterns, idempotency.

May 11, 2026 · 2 min · 416 words · Manvendra Rajpoot

FastAPI Textbook Ch. 8 — WebSockets, SSE, and Streaming Responses

Real-time FastAPI: WebSockets, broadcast / pub-sub, SSE for one-way streams, StreamingResponse, NDJSON, and disconnect handling.

May 6, 2026 · 5 min · 932 words · Manvendra Rajpoot

Integration Cheatsheet 09 — Deployment Stack (Docker + K8s + Migrations)

Cheatsheet: Dockerfile, K8s Deployment, migration Job, secrets, probes, graceful shutdown.

May 16, 2026 · 3 min · 629 words · Manvendra Rajpoot

FastAPI Cheatsheet 09 — Testing with Pytest, AsyncClient, and testcontainers

Cheatsheet: AsyncClient + pytest-anyio, dependency overrides, testcontainers Postgres, factory_boy, OpenAPI tests.

May 11, 2026 · 3 min · 464 words · Manvendra Rajpoot

FastAPI Textbook Ch. 9 — Background Tasks and Task Queues

Background tasks in FastAPI: BackgroundTasks for fire-and-forget, ARQ / Celery / Dramatiq for reliable jobs, scheduling, and long-running operations.

May 6, 2026 · 5 min · 921 words · Manvendra Rajpoot

Integration Cheatsheet 10 — Observability Stack

Cheatsheet: structlog with trace IDs, OTEL auto-instrumentation, Prometheus, slow-query log.

May 16, 2026 · 3 min · 567 words · Manvendra Rajpoot

FastAPI Cheatsheet 10 — Observability: structlog, OTEL, Prometheus

Cheatsheet: structlog with contextvars, OTEL auto-instrumentation, custom spans, Prometheus middleware, /metrics.

May 11, 2026 · 2 min · 395 words · Manvendra Rajpoot

FastAPI Textbook Ch. 10 — Testing FastAPI: Pytest, AnyIO, and Real DBs

Testing FastAPI: TestClient and AsyncClient, dependency overrides, real DB testing with testcontainers, factory fixtures, and CI integration.

May 6, 2026 · 4 min · 762 words · Manvendra Rajpoot