How can I deploy a Django project that uses MongoDB to AWS?
I have a project made using Django and have been using MongoDB and its Compass app and was wondering if you could deploy said project and database together to AWS. I’m not very familiar with AWS.
2
Answers
Use EC2 to build your mongo cluster
An EC2 machine is just a Linux machine (or windows, osx, etc), and yes to scale you have to make more than one ( sharding and replica sets, etc). Your data would be tied to the EBS volume that you mount on the EC2 instance.
If this sounds like a tall order you might want to consider letting MongoDB figure it out for you
Yes, you can absolutely. There are plenty of options to deploy it, depending on your needs.
If you want to use more cloud-native, developer-friendly solution you can play with MongoDB atlas, here are some great AWS explanations on the solution. For your Django app you can try this elastic beanstalk tutorial
If you want to be super quick you can just run ec2 instance with public IP and deploy both your application and MongoDB there. It will require setting up some basic network etc, but it is the quickest to crack on if you know anything about this stuff.
Third option I recommend playing with is containerizing both using docker and running either on Amazon ECS or Amazon Fargate
Any approach you take will require learning about AWS and application deployment practices. I highly recommend doing some beginner AWS course to help yourself with dead-ends or blockers. Udemy and Cloudguru offer really good courses.