Evaluating the AWS services required to deploy a modern Django Web application.
What is Amazon Web Services (AWS)?
Amazon Web Services or AWS as it’s commonly known in the tech industry is the world’s most reliable cloud computing platform. It provides hundreds of unique services which are all cloud-based, ranging from databases to virtual servers.
What is Django?
Django is a python-based open-sourced web framework that follows an MVT (Model-View-Template) architectural pattern. It provides developers with a baseline for deploying secure, reliable, and complex applications that are able to scale.
The AWS services that you will need...
The AWS services above are as follows:
- Identity and Access Management (IAM)
- Certificate Manager (ACM)
- Relational Database Service (RDS)
- Simple Storage Service (S3)
- Elastic Container Registry (ECR)
- Elastic Container Service (ECS)
- Elastic Compute Cloud (EC2)
- Simple Notification Service (SNS)
By default, you will have a root account which you should never use or share with anyone. IAM allows you to create and use a user account instead.
For each individual user that you create, they are assigned an Access Key and a Secret Access Key. You must under no circumstances ever share your access keys! Treat your access key as a username and your secret access key as a password.
You will be able to access AWS programmatically, by adding your access keys to your Django web application. This will allow you to access AWS resources and utilize its services.
AWS certificate manager allows you to create and deploy SSL/TLS certificates. All public TLS certificates that are provisioned by AWS are FREE. SSL/TLS certificates allow your website to be secure with HTTPS.
This will allow you to create a budget and send alarms to your email for example, if you are close to or exceeding your designated budget. This is an essential service in managing the cost of all your AWS resources.
Route53 is DNS (Domain Name System) Service. DNS consists of a collection of rules and records which are used to help users connect to the infrastructure on AWS.
RDS is a managed relational database service. With this service, you will be able to create databases in the AWS cloud.
Such databases include, but are not limited to:
PostgreSQL, MySQL, MariaDB, Oracle etc.
AWS S3 is used to store your files or objects in buckets. All bucket names must have a unique name. You can use S3 to store any type of file that you want – commonly user images or static files.
CloudFront is a content delivery network or CDN. It is used to improve read performance; this is done by caching content at edge locations There are several edge locations that are located globally. This can be used in combination with S3 for your objects.
A “git-hub” like repository that stores all your docker images. These images are then available for use by ECS or Fargate.
Once you have created your docker images with Django and Docker... You will then be able to push your images to ECR, to keep them in storage.
A service that allows you to run your docker containers. With ECS you must manage the cloud infrastructure yourself, which includes the EC2 instances.
Once you have uploaded your docker images to ECR, you will now be able to utilize them with ECS by adding your docker images to containers and then running them.
EC2 is known as Infrastructure as a Service or commonly as IaaS. With EC2 you will be able to rent on-demand virtual machines, scale your instances, and distribute load across your machines.
You will be able to manage your virtual servers with EC2 as well as create an ALB (Application Load Balancer) for your web application. The load balancer will be integrated with ECS.
An AWS service that allows us to quickly deploy or redeploy our application. It ensures that your application is not disrupted in any way by offering zero-downtime deployment (blue/green deployment).
A form of in-memory database that offers high performance and caching. Elasticache offers either a Redis or Memcached database. If you are planning on only using one virtual server for your web application, then this won't be as important.
If however, you are building a complex web application that you expect to grow or if you need additional servers that will scale, then you will need to use Elasticache. Elasticache is incredibly important for caching your users' sessions and ensuring that they are not lost. Without it, your users won't be able to do simple actions, such as logging into your website.
A monitoring service that also collects data formulated as metrics, logs, and events. Essentially CloudWatch is used for showing you statistics on all your AWS resources and services - which you will be able to monitor and manage accordingly.
A fully managed messaging service that can be used to send alerts/messages to you via email about important events. For example, if your EC2 instances are being terminated or new EC2 instances have been launched. Or if there was a failure with your database in RDS.
Now, of course, these are not the only AWS services out there for you to use when deploying your Django web application. The services mentioned above gives you a good framework and guideline to follow. Depending on your use case, you may need fewer or more AWS resources, but now you should have a picture of what services you will typically need in a modern Django web application.