Cloud Native Python Practical techniques to build apps that dynamically scale to handle any volume of data, traffic, or users Manish Sethi BIRMINGHAM - MUMBAI Cloud Native Python Copyright © 2017 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, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be 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. First published: July 2017 Production reference: 1190717 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78712-931-3 www.packtpub.com Credits Author Copy Editor Manish Sethi Sonia Mathur Reviewers Project Coordinator Sanjeev Kumar Jaiswal Prajakta Naik Mohit Sethi Commissioning Editor Proofreader Aaron Lazar Safis Editing Acquisition Editor Indexer Alok Dhuri Rekha Nair Content Development Editor Graphics Lawrence Veigas Abhinash Sahu Technical Editor Production Coordinator Supriya Thabe Nilesh Mohite Foreword In 2000, during the peak of the dotcom boom, I developed web applications in C++ and Perl. One had to personally go to the ISP data center and install the machine along with a RAID setup. From 2003-2006, the world moved to shared hosting powered by virtual machines. Today, the world is a different place, one where cloud computing providers, such as AWS, Azure, Google Cloud, and programming languages such as Python, Ruby, and Scala make it child's play to launch and scale websites. While cloud computing makes it easy to get started, its offerings are ever expanding with new tools, deployment methodologies, and changing workflows. Take, for instance, what compute offerings should a developer build on? Software as a Service, or Platform as a Service, or Infrastructure as a Service Platform? Should the developer choose Docker, or a normal virtual machine setup for deployment? Should the entire software architecture follow an MVC or a microservices model? Manish has a done a good job in the book, equipping a Python developer with skills to thrive in a cloud computing world. The book starts off with laying the foundation of what cloud computing is all about and its offerings. It's beneficial that most chapters in the book are self-contained, allowing the reader to pick up and learn/refresh their knowledge of what's needed for the current sprint/task. The workings of technologies such as CI and Docker are precisely explained in clear prose that does away with the underlying complexity. The Agile model of software development keeps us developers on toes, requiring developers to learn new tools in days and not weeks. The book's hands-on approach to teaching with screenshots on installation, configuration, and compact code snippets equips developers with the knowledge they need, thus making them productive. A preference for full-stack developers, the implicit requirement of knowing cloud computing 101, and CIOs wanting to achieve a lot more with small teams are the norms today. Cloud Native Python is the book a freshman, beginner, or intermediate Python developer should read to get themselves up to speed on the tools and technology that power today's software development. The complexity of cloud computing is in the details, be it the deployment workflow, managing infrastructure, security, or the tooling ecosystem. These choices have lasting implications for the software that's being built and the team developing and maintaining it. Ankur Gupta Founder of NumerateLabs LLP Curator of newsletters: ImportPython & DjangoWeekly About the Author Manish Sethi works as an engineer in Bangalore, India. Over the course of his career, he has worked for startups and Fortune 10 companies, helping organizations adopt a cloud native approach to architecting massively scalable products. He regularly spends time learning and implementing new technology paradigms and actively finds himself solving practical problems using serverless architecture, machine and deep learning, and so on. He contributes to Bangalore DevOps and the Docker community by writing blog posts, giving talks in meetups, and so on. I would like to thank my brother, Mohit Sethi, and my mother, Neelam Sethi, who have been very supportive and encouraged me throughout my career and when writing this book. About the Reviewers Sanjeev Kumar Jaiswal is a computer graduate with 8 years of industrial experience. He uses Perl, Python, and GNU/Linux for his day-to-day activities. He is currently working on projects involving Penetration testing, Source Code Review, Security Design and implementations, and Web and Cloud Security projects. Currently, Sanjeev is learning NodeJS and React Native as well. He loves teaching engineering students and IT professionals, and he has been teaching for the last 8 years in his leisure time. He founded Alien Coders (http://www.aliencoders.org) based on the learning through sharing principle, for computer science students and IT professionals in 2010, which became a huge hit in India among engineering students. You can follow him on Facebook at http ://www.facebook.com/aliencoders, on Twitter at @aliencoders, and on GitHub at http s://github.com/jassics. He has authored Instant PageSpeed Optimization, and co-authored Learning Django Web Development, both by Packt. He has reviewed more than seven books for Packt and looks forward to authoring or reviewing more books for Packt and other publishers. Mohit Sethi is a solutions architect with 10+ years of experience in building and managing products across the IaaS, PaaS, and SaaS space in the areas of cloud, storage, distributed systems, data analytics, and machine learning. Previously, he worked for a Silicon Valley startup, a Fortune 10 company, and a National Defense Organization. He has been an open source contributor for 12+ years and has been running the DevOps meetup group in Bangalore for more than 3 years. You can contact him on Twitter at https://twitter.com/mohitsethi, LinkedIn (https ://in.linkedin.com/in/mohitsethi7), and GitHub (https://github.com/mohitsethi). www.PacktPub.com For support files and downloads related to your book, please visit www.PacktPub.com. 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.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.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. https://www.packtpub.com/mapt Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career. Why subscribe? Fully searchable across every book published by Packt Copy and paste, print, and bookmark content On demand and accessible via a web browser Customer Feedback Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/dp/1787129314. If you'd like to join our team of regular reviewers, you can e-mail us at [email protected]. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products!