Cloud Native Python
eBook - ePub

Cloud Native Python

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

Cloud Native Python

About this book

Build cloud native applications in PythonAbout This Book• This is the only reliable resource that showcases the tools and techniques you need build robust and resilient cloud native applications in Python• Learn how to architect your application on both, the AWS and Azure clouds for high availability• Assess, monitor, and troubleshoot your applications in the cloudWho This Book Is ForThis book is ideal for developers with a basic knowledge of Python who want to learn to build, test, and scale their Python-based applications. No prior experience of writing microservices in Python is required.What You Will Learn• Get to know "the way of the cloud", including why developing good cloud software is fundamentally about mindset and discipline• Know what microservices are and how to design them• Create reactive applications in the cloud with third-party messaging providers• Build massive-scale, user-friendly GUIs with React and Flux• Secure cloud-based web applications: the do's, don'ts, and options• Plan cloud apps that support continuous delivery and deploymentIn DetailBusinesses today are evolving so rapidly that having their own infrastructure to support their expansion is not feasible. As a result, they have been resorting to the elasticity of the cloud to provide a platform to build and deploy their highly scalable applications.This book will be the one stop for you to learn all about building cloud-native architectures in Python. It will begin by introducing you to cloud-native architecture and will help break it down for you. Then you'll learn how to build microservices in Python using REST APIs in an event driven approach and you will build the web layer. Next, you'll learn about Interacting data services and building Web views with React, after which we will take a detailed look at application security and performance. Then, you'll also learn how to Dockerize your services. And finally, you'll learn how to deploy the application on the AWS and Azure platforms. We will end the book by discussing some concepts and techniques around troubleshooting problems that might occur with your applications after you've deployed them.This book will teach you how to craft applications that are built as small standard units, using all the proven best practices and avoiding the usual traps. It's a practical book: we're going to build everything using Python 3 and its amazing tooling ecosystem. The book will take you on a journey, the destination of which, is the creation of a complete Python application based on microservices over the cloud platformStyle and approachFilled with examples, this book takes a step-by-step approach to teach you each and every configuration you need to make your application highly available and fault tolerant.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
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 use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Cloud Native Python by Manish Sethi in PDF and/or ePUB format, as well as other popular books in Computer Science & Cloud Computing. We have over one million books available in our catalogue for you to explore.

Information

Deploying on the AWS Platform

In the previous chapter, we saw one of the platforms for our application, which is called Docker. It can isolate your application, and can be used to respond to your application request from the customer. During the course of this chapter, we will introduce you to the cloud platform, especially AWS (Amazon Cloud Services), which mainly deals with the IaaS (Infrastructure) and PaaS (Platform as a Service) Services. We will also look at how we can build up infrastructure, and deploy our application.
This chapter includes the following topics:
  • Introducing AWS and its services
  • Building application infrastructure using Terraform/CloudFormation
  • Continuous Deployment using Jenkins

Getting started with Amazon Web Services (AWS)

Amazon Web Services (AWS) is a secure cloud platform. It has various offerings in IaaS as well as PaaS, including computing power, database storage, and content delivery, which help in scaling applications, and also grows our business across the globe. AWS is a public cloud, and as per the cloud computing concepts, it provides all its resources in an on-demand delivery with a pay-as-you-go plan.
You can read more about AWS and its services at https://aws.amazon.com/.
As specified previously in Chapter 1, Introducing Cloud Native Architecture and Microservices, you need to create an AWS account to start using the services. You can use the following link to create an account:
https://medium.com/appliedcode/setup-aws-account-1727ce89353e
Once you are logged in, you will see the following screen, which showcases the AWS and its categories. A few of the services are in the beta stage. We will be using some of the services related to compute and networking to build an infrastructure for our application:
Some of the commonly used AWS services for applications are as follows:
  • EC2 (Elastic compute cloud): This is a compute offering from AWS, which, in simply put, offers a server.
  • ECS (Elastic Container Services): This is similar to the Docker services on top of a public cloud, that is, Amazon. It manages Docker on top of an EC2 machine only. Instead of creating a Docker cluster on-premises, you can easily set it up in the Amazon cloud within a few minutes, and with less overhead.
  • EBS (Elasticbeanstalk): This is a PaaS offering where you just need to upload your code, and specify how much infrastructure (basically, app server (EC2)) is required. EBS will take care of creating the machines, and deploy the code on it as well.
  • S3 (Simple storage service): This is a storage service offered by AWS where we usually keep our application data or static content, which could be used for static website hosting. We will be using it for Continuous Deployment.
  • Glacier: This is another storage service, which is mainly used for backup, as it is less costly, and hence, has a slow data storing and retrieving capability as compared to S3.
  • VPC (Virtual Private Network): This is a networking service which gives you control over your resources' accessibility. We will be using this service to keep our infrastructure. This service is very useful for securing our application service and database services, and exposes only selective resources, which are required, to the outside world.
  • CloudFront: This is a content delivery service which distributes your content in S3 across the globe, and makes sure it is quickly retrievable irrespective of the location of the request source.
  • CloudFormation: This gives developers and system administrators an easy way to create and manage a collection of related AWS resources, such as provisioning, and updating them in the form of code. We will be using this service to build our infrastructure.
  • CloudWatch: This service keeps track of the activity of your resources. It also keeps track of any activity on your AWS account in the form of logs, which is useful for identifying any suspicious activity or account compromise.
  • IAM (Identity and Access Management): This service, as the name suggests, is very useful for managing users on the AWS account, and to provide them roles/privileges as per their usage and requirement.
  • Route 53: This is a highly available and scalable cloud DNS Cloud service. We can either migrate our Domain from any other Registrar such as GoDaddy, and others to Route 53, or purchase the Domain AWS.
There are many more services offered by AWS that can't be covered in this chapter. If you are interested and would like to explore other services, you can go through the AWS product list (https://aws.amazon.com/products/).
We will be using most of the aforementioned AWS services. Let's begin by building our infrastructure on AWS as per our application.

Building application infrastructure on AWS

At this stage of our application, the system architect or a DevOps guy comes into the picture, and suggests different infrastructure plans which are secure and efficient enough to handle application requests, and are cost effective as well.
As far as our application is concerned, we will build its infrastructure the same as shown in the following image:
We will follow the preceding architecture diagram for our application, which includes a few of AWS services such as EC2, VPC, Route 53, and so on.
There are three different ways by which you can provision your resources on the AWS cloud, which are as follows:
  • Management console: This is the user interface which we have already logged into, and can be used to launch resources on the cloud. (Check this link for your reference: https://console.aws.amazon.com/console/)
  • Programmatically: We may use a couple of programming languages such as Python, Ruby, and the like to create resources, for which different development tools have been created by AWS, like Codecom. Also, you can use SDK to create your resources ba...

Table of contents

  1. Title Page
  2. Copyright
  3. Credits
  4. Foreword
  5. About the Author
  6. About the Reviewers
  7. www.PacktPub.com
  8. Customer Feedback
  9. Preface
  10. Introducing Cloud Native Architecture and Microservices
  11. Building Microservices in Python
  12. Building a Web Application in Python
  13. Interacting Data Services
  14. Building WebViews with React
  15. Creating UIs to Scale with Flux
  16. Learning Event Sourcing and CQRS
  17. Securing the Web Application
  18. Continuous Delivery
  19. Dockerizing Your Services
  20. Deploying on the AWS Platform
  21. Implementing on the Azure Platform
  22. Monitoring the Cloud Application