Pydantic v2 Textbook Ch. 9 — Settings (pydantic-settings)

Pydantic-settings: typed env config, .env, secrets directory, sources, CLI integration.

May 9, 2026 · 3 min · 495 words · Manvendra Rajpoot

Postgres SQLAlchemy Textbook Ch. 9 — Upsert, Bulk Insert, and COPY

Postgres-specific bulk operations: ON CONFLICT, RETURNING, bulk insert via execute, asyncpg COPY for huge data.

May 8, 2026 · 3 min · 557 words · Manvendra Rajpoot

SQLAlchemy 2.0 Textbook Ch. 9 — Performance: N+1, Bulk Ops, Streaming

Practical SQLAlchemy performance: avoiding N+1, bulk_insert_mappings, server-side cursors, EXPLAIN ANALYZE patterns.

May 7, 2026 · 4 min · 764 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

Pydantic v2 Textbook Ch. 10 — Performance, FastAPI Integration, and Alternatives

Pydantic v2 perf tips, hot path optimization, FastAPI patterns, and when to consider msgspec / attrs.

May 9, 2026 · 3 min · 608 words · Manvendra Rajpoot

Postgres SQLAlchemy Textbook Ch. 10 — Replication, Failover, and pgvector

Streaming replication, read replica routing, failover handling in SQLAlchemy, and using pgvector for embeddings.

May 8, 2026 · 3 min · 618 words · Manvendra Rajpoot

SQLAlchemy 2.0 Textbook Ch. 10 — Migrations and Schema Evolution

Schema migrations: Alembic integration, autogenerate, manual edits, branching, online schema changes, deploy patterns.

May 7, 2026 · 3 min · 599 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

SQLAlchemy 2.0 Textbook Ch. 11 — Testing

Testing SQLAlchemy: real DBs via testcontainers, per-test transactions, factory_boy, async fixtures, and CI patterns.

May 7, 2026 · 4 min · 694 words · Manvendra Rajpoot

FastAPI Textbook Ch. 11 — Observability: Logging, Tracing, and Metrics

Production observability: structlog with contextvars, OTEL tracing, Prometheus metrics, log/trace correlation, and the patterns that pay back.

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