Deploying on AWS

Unless you are Google or Amazon, and need to run thousands of servers, managing your hardware in some data center does not provide many benefits in 2017.

Cloud providers offer to host a solution that is often cheaper than deploying and maintaining your infrastructure. Amazon Web Services (AWS) and others have numerous services that let you manage virtual machines from a web console, and they add new features every year.

One of the latest AWS additions, for example, is Amazon Lambda. Lambda lets you trigger a Python script when something happens in your deployments. With Lambda, you do not have to worry about setting up a server and a cron job, or some form of messaging. AWS takes care of executing your script in a VM automatically, and you only pay for execution time.

Combined with what Docker has to offer, this kind of feature really changes how applications can be deployed in the cloud, and provide a fair amount of flexibility. For instance, you do not have to spend too much money to set up a service that might see a peak in activity and then slow down. You can deploy a world-class infrastructure that can hold an enormous amount of requests, and it stays, in most cases, cheaper than running your hardware.

Moving to your own datacenter might save you money in some cases, but it adds a maintenance burden, and it is a challenge to make your deployments as reliable as if they were running at a cloud provider.

While they make much noise in the press, Amazon or Google outages are rare events (a few hours a year at most), and their reliability is very high. The Service Level Agreement (SLA) for EC2, for example, guarantees an uptime of 99.95% per region or you get some money back. In reality, it is often closer to five nines (99.999%).
You can track cloud providers' uptime values with online tools like https://cloudharmony.com/status-1year-for-aws, but their results should be taken with a pinch of salt because some partial outages are not counted sometimes.

In this chapter, we are going to do two things:

  • Discover some of the features AWS offers
  • Deploy a Flask application on it

The goal of this chapter is not to deploy a complete stack, as it is too long, but to give you a good overview of how microservices can be implemented there.

Let's start with an overview of what AWS has to offer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset