Building Serverless Applications with Python
eBook - ePub

Building Serverless Applications with Python

  1. 272 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Building Serverless Applications with Python

Book details
Book preview
Table of contents
Citations

About This Book

Building efficient Python applications at minimal cost by adopting serverless architecturesAbout This Book• Design and set up a data flow between cloud services and custom business logic• Make your applications efficient and reliable using serverless architecture• Build and deploy scalable serverless Python APIsWho This Book Is ForThis book is for Python developers who would like to learn about serverless architecture. Python programming knowledge is assumed.What You Will Learn• Understand how AWS Lambda and Microsoft Azure Functions work and use them to create an application• Explore various triggers and how to select them, based on the problem statement• Build deployment packages for Lambda functions• Master the finer details about building Lambda functions and versioning• Log and monitor serverless applications• Learn about security in AWS and Lambda functions• Scale up serverless applications to handle huge workloads and serverless distributed systems in production• Understand SAM model deployment in AWS LambdaIn DetailServerless 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.Style and approachThe book takes a pragmatic approach, using a real-world example to demonstrate building efficient, secure, and scalable serverless applications.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Building Serverless Applications with Python by Jalem Raj Rohit in PDF and/or ePUB format, as well as other popular books in Computer Science & Software Development. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781787281134
Edition
1

Logging and Monitoring

We have learned about the concepts of serverless architectures and understood the basics and the internals of AWS's serverless service, AWS Lambda. We have also created some example serverless projects to understand the concepts better. During the course of our learning, we have also learned the basics of several other AWS services, such as alarms, SNS, SQS, S3 buckets, and CloudWatch.
In this chapter, we will learn about how to do the logging and monitoring for the serverless systems that we are building. Logging and monitoring software code and systems are very important, as they helps us with the telemetry and disaster recovery. Logging is a process where we store the logs emitted by our code or by our architecture as a whole. Monitoring is a process where we closely monitor the activities, status, and health of the components and processes in our code or architecture.
So, you will be learning how to set up and understand the monitoring suite of AWS Lambda, which is closely integrated with the monitoring service of AWS, the CloudWatch Dashboards. We will also learn about the logging service of AWS, the CloudWatch Logs service. Finally, we will also learn about and understand the distributed tracing and monitoring service of AWS, the CloudTrail service.
This chapter covers the following topics:
  • Understanding CloudWatch
  • Understanding CloudTrail
  • Lambda's metrics in CloudWatch
  • Lambda's logs in CloudWatch
  • Logging statements in Lambda

Understanding CloudWatch

As mentioned earlier, CloudWatch is the logging and monitoring service of AWS. We have already looked at and learned about the CloudWatch Alarms, which are a sub-feature of CloudWatch. We will now learn about the graphing suite of the service. Almost every service in the AWS environment has a way to send it's logs and metrics to CloudWatch for logging and monitoring purposes. Each service might have several metrics which can be monitored, depending on the function.
Similarly, AWS Lambda also has some metrics, such as the invocation count, the invocation's running time, and so on, which it sends to CloudWatch. It is also helpful to note that the developers can also send custom metrics to CloudWatch. So in the following steps, we shall be learning about the different parts and functions of AWS CloudWatch corresponding to AWS Lambda:
  1. Firstly, let us see what the CloudWatch console looks like and also get a feel for it by navigating around the console. Browse to console.aws.amazon.com/cloudwatch/:
  1. As we can see, there is a lot of information in the CloudWatch console. So, we shall now ...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Packt Upsell
  4. Contributors
  5. Preface
  6. The Serverless Paradigm
  7. Building a Serverless Application in AWS
  8. Setting Up Serverless Architectures
  9. Deploying Serverless APIs
  10. Logging and Monitoring
  11. Scaling Up Serverless Architectures
  12. Security in AWS Lambda
  13. Deploying a Lambda Function with SAM
  14. Introduction to Microsoft Azure Functions
  15. Other Books You May Enjoy