Book Image

Building Serverless Microservices in Python

By : Richard Takashi Freeman
Book Image

Building Serverless Microservices in Python

By: Richard Takashi Freeman

Overview of this book

Over the last few years, there has been a massive shift from monolithic architecture to microservices, thanks to their small and independent deployments that allow increased flexibility and agile delivery. Traditionally, virtual machines and containers were the principal mediums for deploying microservices, but they involved a lot of operational effort, configuration, and maintenance. More recently, serverless computing has gained popularity due to its built-in autoscaling abilities, reduced operational costs, and increased productivity. Building Serverless Microservices in Python begins by introducing you to serverless microservice structures. You will then learn how to create your first serverless data API and test your microservice. Moving on, you'll delve into data management and work with serverless patterns. Finally, the book introduces you to the importance of securing microservices. By the end of the book, you will have gained the skills you need to combine microservices with serverless computing, making their deployment much easier thanks to the cloud provider managing the servers and capacity planning.
Table of Contents (13 chapters)
Title Page
Dedication

The AWS Serverless Application Model CLI

In this section, we will walk through different features of SAM Local with fully-working examples. For local testing, you can use Python and bash like I have shown or you can also use the SAM CLI (https://github.com/awslabs/aws-sam-cli), which at the time of writing is still in beta. It uses Docker and is based on open source docker-lambda (https://github.com/lambci/docker-lambda) Docker images. If you are using Windows 10 Home, I recommend you upgrade to Pro or Enterprise as it's harder to get Docker working on the Home edition. There are also some hardware requirements, such as virtualization, to be aware of. We need to perform the following steps:

  1. Install the AWS CLI (https://docs.aws.amazon.com/cli/latest/userguide/installing.html).
  2. Install Docker CE (https://docs.docker.com/install/).
  3. Install the AWS SAM CLI (https://docs...