Use Python microservices to craft applications that are built as small standard units using proven best practices and avoiding common errors
Key Features:
Become well versed with the fundamentals of building, designing, testing, and deploying Python microservices
Identify where a monolithic application can be split, how to secure it, and how to scale it once ready for deployment
Use the latest framework based on asynchronous programming to write effective microservices with Python
Book Description:
The small scope and self-contained nature of microservices make them faster, cleaner, and more scalable than code-heavy monolithic applications. However, building microservices architecture that is efficient as well as lightweight into your applications can be challenging due to the complexity of all the interacting pieces.
Python Microservices Development, Second Edition will teach you how to overcome these issues and craft applications that are built as small standard units using proven best practices and avoiding common pitfalls. Through hands-on examples, this book will help you to build efficient microservices using Quart, SQLAlchemy, and other modern Python tools
In this updated edition, you will learn how to secure connections between services and how to script Nginx using Lua to build web application firewall features such as rate limiting. Python Microservices Development, Second Edition describes how to use containers and AWS to deploy your services. By the end of the book, you'll have created a complete Python application based on microservices.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Python Microservices Development – 2nd Edition
## 【One-Line Pitch】
A practical, hands-on guide for Python developers who want to move from monolithic applications to microservices using modern async frameworks like Quart, covering everything from design principles to testing, deployment, and scaling. Ideal for backend developers and architects who need concrete patterns, not just theory, for building production-ready microservices.
---
## 【Book Arc】
- **Opening (~0%–9%)**: Establishes the core motivation for microservices by contrasting them with monolithic architecture, covering the origins of service-oriented design, the benefits of small independent services, and—critically—the real pitfalls (illogical splitting, network overhead, data sharing, compatibility, testing) that beginners often underestimate.
- **Early (~9%–25%)**: Introduces Quart as the primary async framework, walking through installation, routing, request/response handling, signals, and extensions. This section also addresses Python version requirements (3.7+), the GIL debate, and why async matters for I/O-bound microservices.
- **Early (~25%–34%)**: Covers configuration management in depth—comparing Python modules vs. JSON/YAML files—and sets up the project skeleton (Jeeves) that will be built throughout the book, including package structure, Makefiles, and settings files.
- **Middle (~34%–47%)**: Dives into testing and documentation: different test types (unit vs. functional), using pytest and tox for automation, load testing with Salvo, Sphinx for API documentation via OpenAPI, version control best practices, and continuous integration setup with badges.
- **Middle (~47%–end)**: Moves into application design with SQLAlchemy for the model layer, MVC/MVT patterns in the context of microservices, and template rendering with Jinja2—setting up the data layer for the Jeeves application.
---
## 【Key Takeaways】
- **Microservices are not a silver bullet** (Opening): The book is refreshingly honest about the costs—illogical service splitting, increased network interactions, data-sharing complexity, compatibility issues, and harder testing. Read this chapter before committing to the architecture.
- **Async frameworks matter for I/O-bound services** (Early): Quart is positioned as the modern choice over Flask because it supports asyncio, which matters when your service spends most of its time waiting on network responses or database queries rather than CPU work.
- **The GIL is not your enemy** (Early): The book explains why the Global Interpreter Lock exists, why removing it hasn't worked, and how it only slightly degrades performance under high load—so don't blame it for your architecture problems.
- **Configuration should be boring and simple** (Early): Python modules as config files are tempting but problematic—they invite code into config, require Python knowledge from ops teams, and complicate deployment. Use JSON or YAML loaded via `app.config` instead.
- **Functional tests are your primary tool** (Middle): Unit tests have their place, but for microservices you'll mostly write functional tests that exercise the full request-response cycle using Quart's `test_client()`, mocking only external network calls.
- **Load testing needs real tools** (Middle): Salvo (a Python Apache Bench equivalent) and Molotov are introduced for simulating concurrent users—but the book wisely notes that numbers vary wildly based on deployment, so use them for relative comparison, not absolute benchmarks.
- **Documentation is code** (Middle): Treating docs as source code—using Sphinx, OpenAPI specs, and tox to rebuild docs on changes—makes maintenance sustainable and keeps API documentation in sync with the actual service.
---
## 【Reading Tips】
- **Skim Chapter 1 if you already know microservices theory**—the pitfalls section is worth a quick read, but the historical context and buzzword-busting can be skipped if you're experienced.
- **Deep-read the Quart chapters (2–3)**—routing, signals, extensions, and configuration are the foundation everything else builds on. The source code links (GitLab for Quart) are worth bookmarking.
- **Pay attention to the testing chapter (4)**—this is where the book earns its keep. The distinction between unit and functional tests, plus the pytest/tox setup, will save you hours of debugging later.
- **The Jeeves example app is your companion**—don't just read the code snippets; actually build along. The book assumes you're running examples in a virtualenv with Python 3.7+.
- **Watch for the configuration pitfalls discussion**—the section on why Python modules make bad config files is a lesson that applies far beyond microservices.
---
## 【Coverage Limits】
The excerpts cover roughly the first half of the book (through ~47%), focusing on fundamentals, Quart, configuration, testing, and initial data modeling. The later chapters on service-to-service interaction (message queues), security (Nginx/Lua rate limiting), containers, and AWS deployment are mentioned in the book description but not covered in this guide.
---
##
Page 7
ic approach The microservice approach Microservice benefits Separation of concerns Smaller projects Scaling and deployment Pitfalls of microservices Illogica...
re was a long transition from Python 2 to Python 3, and had this book been written a few years earlier, we would be discussing the merits of each. However, P...
ings.yml : The application default settings in a YAML file. requirements.txt : The project dependencies following the pip format produced by pip freeze . mys...
us badges. Figure 3.6: GitHub project status badges Summary In this chapter, we have covered the different kinds of tests that can be written for your projec...
eives is growing. We now have to make sure it performs well under load, and also ensure that it is easy to maintain for a growing team of developers. How sho...
for all your service responses is a low-effort change with nginx, and your Python client can benefit from it by setting the right header. Sending compressed...
for Rivest, Shamir, and Adleman, the three authors. The RSA encryption algorithm generates crypto keys that can go up to 4,096 bytes, and are considered secu...
<script src="/static/people.jsx" type="text/babel"></scr <script type="text/babel"> </script> </body> </html> The PeopleBox class is instantiated with the /a...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Python Microservices Development – 2nd edition (Simon Fraser, Tarek Ziadé)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Python Microservices Development – 2nd edition (Simon Fraser, Tarek Ziadé)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment