Building Course Assist Part 8: Deploying the Course Assist backend to AWS.

Building Course Assist Part 8: Deploying the Course Assist backend to AWS.

With the active development of Course Assist now complete I've started the deployment process with the first step being deploying the backend to Amazon Web Services (AWS)😁. The backend was built in Python using Django and the Django rest framework for the API with a PostgreSQL database. I've started with the backend so that I can run some tests and see how the app performs with a deployed server as opposed to a server running on my local machine. So without further ado let's get straight into it.🤸‍♀️

Why I chose AWS🤔

Deciding which platform to deploy the backend to has honestly been difficult for me🥲. I spent a lot of time checking out different services until I landed on AWS. Out of the services I checked out there were 3 that stood out. These were PythonAnywhere, Heroku and AWS. Now these stood out mainly because I've got somewhat of a history with them😂. Let me break it down:

PythonAnywhere: PythonAnywhere was my go-to hosting service for some time because deployment is very straightforward for Python backends and it also has a really good free tier for small projects😏. All of my projects built in Django were deployed to PythonAnywhere so the question is why didn't I use it this time? Well, the two main reasons for this were first because I didn't understand much about the hosting packages they offered besides the free one for small projects😂. Course Assist being an app that could potentially be used by many people, I didn't want to pay for a hosting package that wouldn't meet the app's needs, then again I didn't want to pay a lot for resources that won't be fully utilized🙄. Second, because I'd been using PythonAnywhere for some time I kinda wanted a new experience, something to challenge me a bit. So because of these two reasons, I decided not to use PythonAnywhere.

Heroku: A couple of months ago Heroku was my first choice, I even deployed the Course Assist backend to Heroku on the free tier they offered but then after Salesforce decided to scrap the free tier🙄, I also just decided to move on because I wasn't quite ready to pay the full price just yet.

Amazon Web Services(AWS): I first got a feel of AWS when I did the AWS Fundamentals course in my final year of university last year. Even though I found it kinda complicated with a steep learning curve the more familiar I got with it the more I liked it. Fast forward to present day, at my job I recently had to deploy a Laravel application to AWS EC2 and that further sealed my interest and knowledge of AWS which is why I decided to go for it. I'm not a 100 percent good with AWS though, there are still a lot of things I don't understand that I'm yet to learn and I'm also kinda scared I might find a $1000 bill at the end of the month😅 but I still feel its the best option for me at the moment.

Even though I settled for AWS. All the options mentioned above are very good and I highly recommend them to anyone wanting to deploy a Python Django application.

Deploying to AWS EC2

I decided to deploy to AWS sometime in January but back then the plan was to use Elastic Beanstalk but boy was that a bad idea😂. Not to sound like I'm throwing shade but I found the process of deploying to Elastic Beanstalk very complicated one that I honestly never want to do again🙅‍♂️, and that's how I then came across EC2. So what's EC2? According to the official docs, EC2 is Amazon Elastic Compute Cloud an AWS service that provides scalable computing capacity in the Amazon Web Services (AWS) Cloud.

As mentioned above I recently worked with AWS EC2 at my job to deploy a Laravel project. Because of that, I became quite familiar with EC2 and how it works and it's also way easier to set up as compared to Elastic Beanstalk. Even though I have a pretty decent understanding of EC2 there are still a lot of things I couldn't wrap my head around when deploying the Course Assist backend. I also had to decide whether I'd use EC2 to host the database server or use Amazon Relational Database Service( RDS) for that. But after a good whole 2 days of research😅 I settled on EC2 for everything and then successfully managed to deploy the Course Assist backend to AWS EC2 without much resistance. Via a Django rest API, I'm now able to move data between the two Course Assist apps and the deployed backend.

Next up I want to run some tests and see how the Course Assist apps perform when communicating with a deployed server. With this crucial step completed, I'm now a step closer to the official launch of Course Assist, but before that, I also have to deploy the NodeJs Socket server, something you'll not want to miss so stay tuned to the blog. Thanks for reading and see you in the next one.🙏