{"product_id":"building-production-apis-with-python-fastapi-beyond-9798195071813","title":"Building Production APIs with Python: FastAPI \u0026 Beyond","description":"\u003cp\u003e • Author(s): Malte Eisenberg\u003cbr\u003e • Publisher: Independently Published\u003cbr\u003e • Publisher Imprint: Independently Published\u003cbr\u003e • BISAC: Languages - Python\u003c\/p\u003e\u003cp\u003eMost FastAPI tutorials end where production begins.\u003c\/p\u003e\u003cp\u003eThere's a gap - sometimes a chasm - between an API that works on a developer's laptop and an API that works at three in the morning under a load spike with one of the database replicas down. Most tutorials live on one side of that gap. \u003cb\u003eThis book lives on the other.\u003c\/b\u003e\u003c\/p\u003e\u003cp\u003eFastAPI makes it pleasant to write the laptop version of an API: type hints become validation, docstrings become documentation, async functions become a real concurrency story. The framework removes so much friction that you can ship a working endpoint in twenty minutes. That is its great strength and, paradoxically, its trap - because shipping the laptop version to production is how every team rediscovers the same handful of issues: secrets in source files, an authentication flow that works only for the happy path, a cache invalidation strategy that turns into a herd of database queries the moment Redis blinks, a test suite that can't be run in CI, a deployment story that consists of one engineer who knows how to do it.\u003c\/p\u003e\u003cp\u003e\u003cb\u003eThis book attacks those failure modes head-on.\u003c\/b\u003e\u003c\/p\u003e\u003cp\u003eAcross twelve chapters and a single continuing project - the \u003ci\u003eArticles \u0026amp; Users API\u003c\/i\u003e - you build a service that has every capability production demands and none of the demo-code shortcuts that fail under real load. The project starts in Chapter 2 as a single file with two endpoints. By Chapter 12 it is a containerized service with JWT authentication, refresh-token rotation, optional MFA, per-user rate limiting, a two-tier cache, two API versions running in parallel, OpenAPI documentation, a passing test suite, an observability stack, and Kubernetes manifests.\u003c\/p\u003eWhat you'll build: \u003cul\u003e\n\u003cli\u003eA typed, async-native API using \u003cb\u003eFastAPI 0.115]\u003c\/b\u003e and \u003cb\u003ePydantic v2\u003c\/b\u003e\n\u003c\/li\u003e\n\u003cli\u003eJWT authentication with refresh-token rotation and reuse detection\u003c\/li\u003e\n\u003cli\u003eMulti-factor auth (TOTP) with hashed backup codes\u003c\/li\u003e\n\u003cli\u003eRole-based access control and API key authentication\u003c\/li\u003e\n\u003cli\u003eRedis-backed rate limiting that actually pipelines correctly\u003c\/li\u003e\n\u003cli\u003eCache-aside with stampede protection - the failure mode no tutorial mentions\u003c\/li\u003e\n\u003cli\u003eTwo API versions running side-by-side with a real deprecation lifecycle\u003c\/li\u003e\n\u003cli\u003eOpenAPI documentation consumers can actually use\u003c\/li\u003e\n\u003cli\u003eA test suite using modern httpx with ASGITransport\u003c\/li\u003e\n\u003cli\u003ePerformance work backed by profiling, not guesswork\u003c\/li\u003e\n\u003cli\u003eA production deployment with Docker, Kubernetes, OpenTelemetry, and graceful shutdown\u003c\/li\u003e\n\u003c\/ul\u003eThis book is for you if: \u003cul\u003e\n\u003cli\u003eYou're comfortable with Python and HTTP basics, but want to ship something beyond a tutorial demo\u003c\/li\u003e\n\u003cli\u003eYou've built an API that worked in development and broke in production - and want the patterns that prevent that\u003c\/li\u003e\n\u003cli\u003eYou're tired of fragmented blog posts that show pieces but never the integrated whole\u003c\/li\u003e\n\u003cli\u003eYou want one continuous project that grows from a single endpoint into a deployable service\u003c\/li\u003e\n\u003c\/ul\u003e\u003cb\u003eWhat this book is not: \u003c\/b\u003e\u003cp\u003eAn exhaustive FastAPI reference, a Python tutorial, or a microservices manifesto. It's an opinionated field guide that names tradeoffs, picks sides, and ends every chapter pointing at what comes next.\u003c\/p\u003eStack (pinned in Appendix C): \u003cp\u003ePython 3.12, FastAPI 0.115+, Pydantic 2.9+, SQLAlchemy 2.0 async, PyJWT, Redis 5+, httpx 0.27+, pytest 8+. Every example was tested against this exact stack.\u003c\/p\u003eThe companion code is free.\u003cp\u003eDownload the complete Articles \u0026amp; Users API repository - including Dockerfile, docker-compose stack, Kubernetes manifests, and a passing test suite - at the link printed on the About page.\u003c\/p\u003e\u003cp\u003e\u003ci\u003eTake what is useful, argue with what is not, and ship the thing.\u003c\/i\u003e\u003c\/p\u003e","brand":"Independently Published","offers":[{"title":"Paperback","offer_id":47883001233559,"sku":"9798195071813","price":2371.0,"currency_code":"INR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0666\/3471\/1191\/files\/9798195071813.webp?v=1781098708","url":"https:\/\/atlanticbooks.com\/products\/building-production-apis-with-python-fastapi-beyond-9798195071813","provider":"Atlantic Books","version":"1.0","type":"link"}