The engineering notebook
RSS feed#fastapi
Articles, practical guides, and engineering notes on fastapi.
By Ashish Bhakhand 108 published articles
Explore the articles
14 articles
Reset filtersRate Limiting Is a Product Policy, Not Just Middleware
Choose identities, limits, storage, status codes, and retry behavior based on cost and user experience.
Testing FastAPI Without Starting the Real Application
Build focused test applications, override dependencies, and test services at their natural boundaries without production infrastructure.
Strict JWT Validation Without Algorithm Confusion
Validate JWT algorithms, signatures, issuers, audiences, and required claims deliberately before trusting user identity.
Production FastAPI Middleware: Order Matters
Build request context, body limits, host checks, CORS, compression, and logging in an order that preserves reliable behavior.
Designing a Stable API Envelope in FastAPI
Give mobile and web clients one predictable success, error, retry, and request-correlation contract.
Who Owns the Transaction in a FastAPI Application?
Place transaction boundaries around complete business operations without pushing orchestration into routes or hiding it inside unrelated queries.
Direct SQL with asyncpg: Why I Do Not Add an ORM Automatically
Direct PostgreSQL access can make queries, constraints, and atomic behavior clearer when the team is willing to own the SQL.
FastAPI Lifespan: Managing Databases, Schedulers, and Shared Clients
Give long-lived resources clear startup and shutdown ownership instead of constructing them inside requests.
Fail Fast with Pydantic Settings
Validate environment variables, production transport security, and operational limits once during startup.