Skip to Content
Python Microservices with FastAPI
book

Python Microservices with FastAPI

by Giunio De Luca, Gianmarco Aversano
December 2026
Beginner to intermediate
357 pages
1h 5m
English
Packt Publishing

Overview

Design and ship production-ready FastAPI microservices from first service to secure authentication, bookings, reviews, smart search, AI-assisted support, reliable testing, and a confident path to scalable production systems

Key Features

  • Design clear, evolvable services, and explain decisions your team trusts
  • Ship reliable backends with the right data stores, async jobs, auth, testing, and observability
  • Add practical AI features (RAG, agents) that reduces support and drives measurable value

Book Description

This book shows you how to turn an idea into a reliable product.

This is a playbook for practical progress. Choose what to ship now, what to delay, and how to avoid risky changes. Keep services tidy, naming clear, and tests small but useful. You will build a realistic end-to-end system step by step, following the evolution of a babysitting marketplace platform with sign-up, search, booking, messaging, and payments delivered in steady increments.

When it is time to add intelligence, you learn practical ways to use AI for customer support, recommendations, and operational insights. The focus stays on measurable value, not hype, while keeping performance, costs, and reliability predictable in production.

Your guides are Giunio De Luca, PhD, author of Packt’s FastAPI Cookbook and an architect who has shipped systems across research, sports, and energy, and Igor “Benav” Magalhães, founder of Benav Labs and maintainer of widely used open-source tools. They share patterns they rely on when deadlines are real and reliability matters.

By the end, you will not just know FastAPI. You will think like a senior engineer, plan delivery with confidence, avoid common traps, measure what matters, and run a backend platform that users trust and teams enjoy maintaining.

What you will learn

  • Set up a microservice from scratch with modern Python tooling
  • Build RESTful APIs with clean boundaries, DI, and type-safe models
  • Design multiple services and compose them through a gateway
  • Model data with PostgreSQL, MongoDB, and vector stores
  • Scale with async I/O, background tasks, queues, and WebSockets
  • Secure services with OAuth2/JWT and role-based access
  • Test, profile, observe, and deploy with confidence
  • Add AI features including RAG chatbots, agents, and analytics

Who this book is for

For Python developers who want to move beyond monoliths and ship scalable backends. Ideal for engineers aiming for lead/architect roles who need practical patterns for clean code, async workflows, and multi-database design. You’ll learn how to add secure authentication, real-time features, and AI capabilities RAG chat, agents, and analytics without losing testability or performance. Basic Python and web API knowledge is recommended.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Building Python Microservices with FastAPI

Building Python Microservices with FastAPI

Sherwin John C. Tragura
Python for DevOps

Python for DevOps

Noah Gift, Kennedy Behrman, Alfredo Deza, Grig Gheorghiu

Publisher Resources

ISBN: 9781835461167