python-serverless-book

Preface

📝 Important Note from the Author: This book was written in 2019 but remained incomplete. Upon reflection, I realized that the approach presented here may not be the optimal solution for many use cases. The technology landscape has evolved significantly since then, particularly with advances in AI, containerization, and cloud-native solutions.

While the technologies covered (Python, Django, AWS Lambda, serverless patterns) remain relevant and valuable in specific scenarios, today’s architectural decisions should consider the broader ecosystem and your team’s capabilities. This book is made publicly available as a learning resource for those interested in serverless development, with the understanding that current best practices may differ from the approaches described here.

The core concepts and hands-on examples remain educational and applicable, so please use this material as a stepping stone in your learning journey.

I’ve decided to write this book because technology advances very quickly, but many of the developers who work in this field cannot catch up with all the changes. There are many new programming languages, frameworks, and libraries coming out every day. Some of them will be part of the future, while others will unfortunately become obsolete in just a few years. Picking the correct technologies is, for us, a challenging task; it requires days or even weeks to learn a new technology, and sometimes we find that because one of the big players in the industry decides not to adopt it, we soon realize that we have wasted time and need to learn another, hopefully better, technology.

My goal with this book is to introduce you to several technologies—most of them are either very mature, supported by large companies, or groundbreaking. That might not make too much sense yet, but those are the key points I’ve used to pick the technologies we’ll explore here, and in my opinion, they are critical for building the stack we are going to work on.

Who This Book Is For

This book is intended for developers with at least some basic knowledge in website development. I’ll try to explain each part from the beginning, but because there are a lot of things happening with each line we write and with each click we make, it might be hard to understand what’s going on under the hood if you have never developed a website.

The technologies presented are being used by both small and large companies. Developers and software architects in large companies will be able to get a grasp of the most recent technologies and maybe decide to migrate some key parts of their systems. Migrating legacy software is always a challenge, but you might discover that using some of these technologies, it’s possible to save costs and improve your system’s reliability at the same time.

The focus in this book, however, is for developers in small companies, in startups, or those trying to create a new project from scratch. I will go in depth with the reasons in the first chapter, but I believe it’s enough for now to say that this stack we will be building has all the desirable characteristics a startup company wants.

What This Book Is Not

A Manual on a Technology or Product

We try to explain a lot of things in this book—different technologies, languages, and frameworks that can be put together to build a complete solution that works very well for us. Because of that, each of the topics we will be talking about are not in-depth. If you have never used Python or Docker, you might want to learn more about them later using a book specific to that. We will try to cover the most common cases, and it will hopefully be enough to get started using these technologies.

An Installation Guide

Installing software is usually an easy task. There are plenty of manuals and tutorials on the Internet you can use. It’s true that some of them require lots of extra steps and manual work, but it would be too time-consuming to explain all the possible issues and configurations you can have to deal with while installing new software. I assume you will be able to quickly install and set up the required software very quickly. If there are any special considerations you need to take into account, there will be a note for that.

A Security Guide

Security is a complicated issue. The examples in this book follow the best practices a non-security expert can follow. If you will be handling highly sensitive information, such as credit card information or social security numbers, it’s always recommended to get advice from a security expert. All systems can be hacked; it’s just a matter of making it as hard as possible. My best advice is: invest time in investigating as much as you can and take the matter seriously.

A Note to Windows Users

You’re welcome. We will be using a lot of tools that are intended for *nix systems; however, we have tested all of them on Windows, and all the examples shown here work fine. Because some of the tools need to be compiled from the source, you might need to install the Visual Studio C++ redistributable package and/or other tools, but it shouldn’t be hard for the libraries we will be using. Using a virtual machine with Linux is always another option if you need it. In general, however, because we will be using a virtualized environment, you shouldn’t have much trouble.

Online Resources

All the examples in the code and the errata are available at the following site:

https://serverless-site.com

Make sure to check it and run the examples yourself. We have included the files in all the major examples included in this book so you can easily find the related file at that URL.

Thanks for coming along with me on this journey of building web apps in a better way.

Diego Jancic


Next: Chapter 1 - Introduction →