Book Image

Building Serverless Applications with Python

Book Image

Building Serverless Applications with Python

Overview of this book

Serverless architectures allow you to build and run applications and services without having to manage the infrastructure. Many companies have adopted this architecture to save cost and improve scalability. This book will help you design serverless architectures for your applications with AWS and Python. The book is divided into three modules. The first module explains the fundamentals of serverless architecture and how AWS lambda functions work. In the next module, you will learn to build, release, and deploy your application to production. You will also learn to log and test your application. In the third module, we will take you through advanced topics such as building a serverless API for your application. You will also learn to troubleshoot and monitor your app and master AWS lambda programming concepts with API references. Moving on, you will also learn how to scale up serverless applications and handle distributed serverless systems in production. By the end of the book, you will be equipped with the knowledge required to build scalable and cost-efficient Python applications with a serverless framework.
Table of Contents (11 chapters)

What this book covers

Chapter 1, The Serverless Paradigm, introduces the reader to the concepts of microservices and serverless architectures, and provides a clear understanding of the pros and cons.

Chapter 2, Building a Serverless Application in AWS, covers AWS Lambda and explains the concepts, workings, and the components involved in the tool in detail. It also explains the nuances involved in security, user controls, and versioning code inside Lambda.

Chapter 3, Setting Up Serverless Architectures, goes into further detail about the various triggers in AWS Lambda and how they integrate with the functions. The reader will learn what the event structure of each trigger will look like and how to modify the Lambda function with respect to the type of trigger used.

Chapter 4, Deploying Serverless APIs, explores the AWS API Gateway and also teaches the reader how to build efficient, scalable serverless APIs using the API Gateway and Lambda. It goes on to teach the reader how to improve the API by adding authorization and how to set up user-level controls such as throttling of requests.

Chapter 5, Logging and Monitoring, presents the concept of logging and monitoring in serverless applications. This is mostly still an unsolved problem in this domain. This chapter guides the reader through setting up logging and monitoring in the AWS environment with Python via custom metrics and logging. This chapter also goes into the details of best practices when it comes to logging and monitoring Lambda functions in Python.

Chapter 6, Scaling Up Serverless Architectures, discusses the practice of scaling up serverless architectures for large workloads using several third-party tools. This chapter also teaches the reader how to handle security, logging, and monitoring using the available Python modules.

Chapter 7, Security in AWS Lambda, teaches readers to deploy secure serverless applications by leveraging the AWS security features available. This involves having strict controls on components that the application can access, on the users who can handle or access the application, and so on. This also involves understanding AWS virtual private clouds and subnets for an in-depth understanding of the security features and best practices you can follow in AWS Lambda.

Chapter 8, Deploying a Lambda Function with SAM, looks at how to deploy Lambda functions as infrastructure as code via the Serverless Application Model, which is a new way of writing and deploying Lambda functions that makes it easier to integrate with other IaaS services, such as CloudFormation.

Chapter 9, Introduction to Microsoft Azure Functions, familiarizes the reader with Microsoft Azure Functions, and explains how to configure and understand the components of the tool.