Table of Contents

  • Why Microservices?
  • Modularity
  • Flexibility
  • Robustness
  • Ownership
  • How Small Is “Micro”?
  • The Microservice-Monolith Trade-Off
  • Example Microservices
  • Why RPC and Protocol Buffers?
  • Documentation
  • Validation
  • Performance
  • Developer-Friendliness
  • Example Implementation
  • The RPC Client
  • The RPC Server
  • Tying It Together
  • Production-Ready Python Microservices
  • Docker
  • Networking
  • Docker Compose
  • Testing
  • Deploying to Kubernetes
  • Python Microservice Monitoring With Interceptors
  • Why Not Decorators
  • Interceptors
  • Best Practices
  • Protobuf Organization
  • Protobuf Versioning
  • Protobuf Linting
  • Type Checking Protobuf-Generated Code
  • Shutting Down Gracefully
  • Securing Channels
  • AsyncIO and gRPC
  • Conclusion

Microservices are a way to organize complex software systems. Instead of putting all your code into one app, you break your app into microservices that are deployed independently and communicate with each other. This tutorial teaches you how to get up and running with Python microservices using gRPC, one of the most popular frameworks.

Implementing a microservices framework well is important. When you’re building a framework to support critical applications, you must ensure it’s robust and developer-friendly. In this tutorial, you’ll learn how to do just that. This knowledge will make you more valuable to growing companies.

In order to benefit most from this tutorial, you should understand the  basics of Python and web apps. If you’d like a refresher on those, read through the links provided first.

By the end of this tutorial, you’ll be able to:

  • Implement microservices in Python that communicate with one another over gRPC
  • Implement middleware to monitor microservices
  • Unit test and integration test your microservices and middleware
  • Deploy microservices to a Python production environment with Kubernetes


Python Microservices with GRPC
8.75 GEEK