DEV Community

Cover image for How does AWS Deployment work?
b.chau504
b.chau504

Posted on

How does AWS Deployment work?

What is AWS?

Are you considering deploying your application with Amazon Web Services(commonly known as AWS)? Not entirely sure what deployment service to use for your code? Maybe you're just curious about how AWS works, or if their services would be something you want to use. Well there's a reason more than 45 percent of the world is using AWS today. It is widely used by many small businesses, large-scale companies and government agencies. AWS has a variety of services from data centers to compute services to cloud platforms, just to name a few. Actually, AWS has over 200 services. Some of the few AWS services that we'll be exploring to deploy your next application:


Deployment before AWS

Let's take it back once more to see how developers would deploy their code. Before AWS dominated the cloud computing industry, developers would manually log into the server and run deployment scripts. The problem with this was that it was extremely risky. Businesses would have to plan for and acquire servers and IT infrastructure weeks or months ahead of time.

Amazon EC2

Amazon EC2 makes it easy for you to obtain virtual servers(also known as compute instances in the cloud) quickly. AWS gives you the freedom to launch as many or as few virtual servers as you need, configure security and networking, and manage storage.

Mutable Infrastructure

Manually connecting to a single Amazon EC2 instance to deploy new code has certain drawbacks. There's a possibility something may go wrong with your code or scripts, causing all users to be affected. If you test your code on a development server, there's always the possibility that it won't work on the production server.
This is referred to as mutable infrastructure.

Assume someone logged in, made a change, and then failed to update the development server. Your deployment in one mutable server may respond differently in another mutable server.


Mutable Infrastructure vs Immutable Infrastructure


Immutable Infrastructure

With immutable infrastructure, there are no changes taking place on the production server. Which allows us to implement control changes so that our running code updates in a predictable manner. The running code only updates when it is completely replaced with a new instance that contains all the necessary changes.

Consider the example above.

With two instances, one instance can be for deployment and while the other one keeps serving the traffic. What happens when an instance fails or has an increase in traffic? AWS has a service to solve that problem also.

AWS Auto Scaling

Auto Scaling

Auto scaling is an effective method of ensuring the availability and predictable performance of many instances that serve traffic. As the demand on your instances varies, Amazon EC2 Auto Scaling allows you to dynamically raise or reduce the number of instances. When an instance fails or there is a spike in traffic, auto scaling automatically creates new instances immediately by utilizing an AMI (Amazon Machine Image). The operating system and all software packages required to run the application are included in AMIs.

Amazon Elastic Load Balancing(Amazon ELB)

Your incoming application traffic is dynamically distributed across all of your running EC2 instances using Elastic Load Balancing. Elastic Load Balancing distributes incoming requests across several servers, ensuring that no one server is congested.

Attach the load balancer to your Auto Scaling group if you want to use Elastic Load Balancing with it. This connects your Auto Scaling group to the load balancer, which serves as a central point of contact for any and all incoming web traffic.

Individual EC2 instances do not need to be registered with the load balancer while using Elastic Load Balancing with your Auto Scaling group. The load balancer automatically registers instances that are launched by your Auto Scaling group. Similarly, instances removed from your Auto Scaling group get deregistered from the load balancer automatically.

The Ease of Deploying with AWS CodeDeploy

AWS CodeDeploy makes it simple to automate code deployments while still maintaining application uptime. Its automated deployment capabilities make it an excellent solution for updating application and promptly release new features without the risk of errors.


Conclusion

Every coder, programmer, developer(call it what you will) will deploy their application to a server at some point throughout their career. It doesn't matter if it's a large server or a small server. It might be one or a hundred servers. Whatever your requirements are, you'll most likely want to have servers as quickly and efficiently as possible.

Understanding a bit about AWS can help you advance in your profession and find your next job. You can pursue a variety of certifications and positions that Amazon offers. It's perfectly fine if you're not interested in working for Amazon. AWS skills, on the other hand, are in high demand for almost any developer position. So, are you planning to use any of Amazon's online services?

Top comments (0)