Book Image

Daniel Arbuckle's Mastering Python

By : Daniel Arbuckle
Book Image

Daniel Arbuckle's Mastering Python

By: Daniel Arbuckle

Overview of this book

Daniel Arbuckle's Mastering Python covers the basics of operating in a Python development environment, before moving on to more advanced topics. Daniel presents you with real-world solutions to Python 3.6 and advanced-level concepts, such as reactive programming, microservices, ctypes, and Cython tools. You don't need to be familiar with the Python language to use this book, as Daniel starts with a Python primer. Throughout, Daniel highlights the major aspects of managing your Python development environment, shows you how to handle parallel computation, and helps you to master asynchronous I/O with Python 3.6 to improve performance. Finally, Daniel will teach you the secrets of metaprogramming and unit testing in Python, helping you acquire the perfect skillset to be a Python expert. Daniel will get you up to speed on everything from basic programming practices to high-end tools and techniques, things that will help set you apart as a successful Python programmer.
Table of Contents (13 chapters)

Building high-level microservices with Flask

So, we had a look at what a microservice is and why structuring our servers as collection of microservices is helpful. Now, let's take a look at the practicalities and use Flask to construct a functioning microservice.

Microservices can be pretty easily divided into those that use web technologies, such as HTTP, to communicate with each other and those that use a dedicated inter-process communication or a remote-procedure-called mechanism to communicate.

There are advantages to each, depending on the specific needs of a project and neither is inherently easier to work with. However, I'm going to refer to microservices that use web technologies to communicate as high level because they are inherently closer to the level at which users operate. Conversely, I'll refer to microservices that use specialized protocols as low...