Hands-On Docker for Microservices with Python
Design, deploy, and operate a complex system with multiple microservices using Docker and Kubernetes
Jaime Buelta
BIRMINGHAM - MUMBAI
Hands-On Docker for Microservices with Python
Copyright 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Richa Tripathi
Acquisition Editor: Shriram Shekhar
Content Development Editor: Ruvika Rao
Senior Editor: Afshaan Khan
Technical Editor: Romy Dias
Copy Editor: Safis Editing
Project Coordinator: Francy Puthiry
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Production Designer: Nilesh Mohite
First published: November 2019
Production reference: 1211119
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-83882-381-8
www.packt.com
To my wife, Jordana, for loving me more than I deserve.
Packt.com
Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Fully searchable for easy access to vital information
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Jaime Buelta has been a professional programmer since 2002 and a full-time Python developer since 2010. He has developed software for a variety of fields, focusing, in the last 10 years, on developing web services in Python in the gaming and finance industries. He has seen first hand the revolution of containerization for backend services over the years and has seen how they can improve the development process. He published his first book, Python Automation Cookbook, in 2018. He is a strong proponent of automating everything to make computers do most of the heavy lifting so that users can focus on the important stuff. He is currently living in Dublin, Ireland, and is a regular speaker at PyCon Ireland.
This book could not have happened without the encouragement and support of my wonderful wife, Jordana. I also want to thank the team at Packt, especially Manjusha and Ruvika, the editors, who have been a huge help throughout the process. Also, a great thanks to Sean for his great suggestions and for improving the book. Finally, I'd like to thank the whole Python community. I can't overstate what a joy it is to work as a developer in the Python world.
About the reviewer
Sean O'Donnell is a software architect with 19 years of industry experience. He specializes in web applications and systems architecture. Sean has worked on everything from parking meters to Triple A (AAA) games. He is a particular fan of the Python language, ecosystem, and community, and is the founder of Python Ireland. In his spare time, he collects and restores vintage and antique hand tools. Sean lives and works in Dublin, Ireland, with his wonderful fianc and their three awesome children.
I'd like to thank Aine, Ada, Astrid, and Cian, who put up with me ignoring them while working on this book!
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
The evolution of software means that systems are getting bigger and more complex, making some of the traditional techniques for dealing with them ineffective. The microservice architecture has gained traction in recent years as an effective technique for dealing with complex web services and allowing more people to work on the same system without interfering with one another. In a nutshell, it creates small web services where each one solves a specific problem, and they all coordinate together through well-defined APIs.
In this book, we will explain in detail the microservice architecture and how to successfully run it, enabling you to understand the architecture at a technical level as well as understand the implications of the architecture for teams and their workloads .
For the technical aspects, we will use well-tailored tools, including the following:
- Python, to implement RESTful web services
- Git source control, to track the changes in an implementation, and GitHub, to share those changes
- Docker containers, to standardize the operation of each of the microservices
- Kubernetes, to coordinate the execution of multiple services
- Cloud services, such as Travis CI or AWS, to leverage existing commercial solutions to problems
We will also cover practices and techniques for working effectively in a microservice-oriented environment, the most prominent being the following:
- Continuous integration, to ensure that services are of a high quality and ready to be deployed
Next page