Book Image

Python Microservices Development – 2nd edition - Second Edition

By : Simon Fraser, Tarek Ziadé
Book Image

Python Microservices Development – 2nd edition - Second Edition

By: Simon Fraser, Tarek Ziadé

Overview of this book

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.
Table of Contents (14 chapters)
Other Books You May Enjoy

To get the most out of this book

Readers will find the book easier to follow with some Python programming experience, or experience in a very similar programming language. The basics of Python are not covered, and for the fundamentals we recommend a book such as Learn Python Programming, also from Packt Publishing.

Running the code samples from this book requires a computer with Python 3.8 or greater installed on it. Python is available for free for all popular operating systems, such as Windows, macOS and Linux, among others.

The author recommends not only running the code samples, but also experimenting with them to try different things out.

Download the example code files

The code bundle for the book is hosted on GitHub at We also have other code bundles from our rich catalog of books and videos available at Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here:

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example; " The __name__ variable, whose value will be __main__ when you run that single Python module, is the name of the application package."

A block of code is set as follows:

@app.route('/api', methods=['POST', 'DELETE', 'GET']) 
def my_microservice(): 
    return {'Hello': 'World!'}

Any command-line input or output is written as follows:

pip install quart

Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes. For example: "There are many great synchronous frameworks to build microservices with Python, like Bottle, Pyramid with Cornice, or Flask."

Warnings or important notes appear like this.

Tips and tricks appear like this.