I am using Heroku for my django web app, but I don't want to use it anymore, but now I am looking for a way to migrate the app from Heroku to AWS elastic bean I would love to hear that please explain and i am using django defualt sqlite3 db
There are many way to migrate to AWS, it depends on which approach you would like to go for.
You have the expertises in managing server and don't mind maintaining it; Use EC2: https://medium.com/saarthi-ai/ec2apachedjango-838e3f6014ab
You just want to deploy it and don't want to deal with server/patching and so on using Elastic BeanStalk: https://www.andrlik.org/dispatches/migrate-django-heroku-elastic-beanstalk/
Cost is very important to you, you may use AWS lightsail: https://aws.amazon.com/getting-started/hands-on/deploy-python-application/
You application is containerized, you may use AWS ECS: https://testdriven.io/blog/deploying-django-to-ecs-with-terraform/
Related
I tried to deploy my Django project to beanstalk (no docker). It seems to me that I can only choose AWS RDS as my database choice. Could I install PostgreSQL in the same beanstalk instance?
If so, how could I install PostgreSQL myself? Using RDS is just an additional cost for me. So, I am looking for cheap solution. Possibly SQLite3 is a solution? But I hope to use PostgreSQL.
Could I install PostgresSQL in the same beanstalk instance?
Yes, you could. But this will require a bit of "manual" setup and it will be not-scalable nor really fault tolerant. With RDS you pay premium, but you get fully managed, highly scalable and reliable database.
But of course, not all use cases require using RDS. In this case you could install PostgreSQL on your EB instance (I assume single-instance EB environment). For this you would need to setup a number of configuration options in .ebextensions. However, this process is not that easy as you would highly-couple your application deployments with the DB.
As a middle ground, I think it would be better to install PostgreSQL on a separate, dedicated instance. This way your EB instance and the DB are de-coupled, easier to manage, update, backup and scale.
Can some one please advise the steps required for migrating a web application which is currently running on tomcat server at onpremise to AWS ec2 instance. I understand this is not a straight forward and requires some detailed process.
The code is wrriten in Java and database used as oracle.
So it would be helpfull if someone can suggest me any relavent document or any website which gives some demo to refer me and proceed with this scenario.
If it's a personal project then I would recommend Lightsail as the simplest way to deploy existing Java application.
For a database a small instance of MySQL or if relational database is not needed then a document database like DynamoDB. https://aws.amazon.com/products/databases/?nc2=h_m1
There are multiple choices one how to migrate a Java application to AWS.
You could potentially use existing AWS services like:
Lightsail - https://aws.amazon.com/lightsail/
Beanstock - https://aws.amazon.com/elasticbeanstalk/
or
EC2 instance and install Tomcat manually
Use ECS with Docker https://aws.amazon.com/getting-started/tutorials/deploy-docker-containers/?nc2=type_a
As for Database solution Oracle is an option but quite expensive one.
When moving to AWS it's better to use one of the RDS managed databases like MySQL, Postgress or more expensive like Aurora.
In order to propose an architecture some details would be needed on predicted load, the size of the application and volume of data. Is the product regional or global, are there any additional issues that need to be addressed while moving to a cloud (performance, availability etc), how users are authenticated (are any other services needed).
I am new to AWS and the variety of options is overwhelming.
I run my app localy in docker. Now I want to move it to AWS so I can access it in browser remotely. What is the easiest configuration for my case?
If you are new to AWS, I suggest it would be better to take a minute to understand what and how AWS works.
However, for your scenario, assuming you are good with docker, you can follow the this tutorial. AWS has a container service called ECS and I suggest you stick to it.
I searched online but can't find a good answer to what the key differences are between AWS Lambda vs Heroku. I can for example write Node JS but when should I use Lambda and when Heroku?
AWS Lambda is for creating server side apps based on serverless architecture, while Heroku is a platform as a service (PaaS) which can be used to build and run server apps.
Heroku is a service which provides tools to deploy, manage, and scale server applications.
You can use node.js, go, python, etc. for your server app which runs on a Heroku instance.
Here are the key differences:
On Lambda you pay for the computation time, while on Heroku you pay monthly.
Lambda instances are created on demand, while Heroku instance is always running.
Heroku provides add-ons which are easy to use to integrate third party services, such as MailGun and Redis, in your service.
If your service is just going to do something simple such as converting an image and saving it on a S3 bucket, you can use AWS Lambda, but if you are creating a complex service which is doing multiple different tasks, it is better to use Heroku and choose a language/framework which fits your needs.
You can learn more on serverless architecture here.
I've been following the official Amazon documentation on deplaying to the Elastic Bean Stalk.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python.html
and the customization environment
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html#customize-containers-format
however, I am stuck. I do not want to use the built in RDS database I want to use mongodb but have my django/python application scale as a RESTful frontend or rather API endpoint for my users.
Currently I am running one EC2 instance to test out my django application.
Some problems that I have with the Elastic Bean:
1. I cannot figure out how to run commands such as
pip install git+https://github.com/django-nonrel/django#nonrel-1.5
Since I cannot install the device mongo driver for use by django I cannot run my mongodb commands.
I was wondering if I am just skipping over some concepts or just not understanding how deploying on the beanstalk works. I can see that beanstalk just launches EC2 instances and possibly need to write custom scripts or something I don't know.
I've searched around but I don't exactly know what to ask in regards to this. Top results of google are always Amazon documents which are less than helpful in customization outside of their RDS environment. I know that Django traditionally uses RDS environments but again I don't want to use those as they are not flexible enough for the web application I am writing.
You can create a customize AMI to your specific needs the steps are outline in the AWS documentation below. Basically you would create a custom AMI with the packages needed to host your application and then update the Beanstalk config to use your customize AMI.
Using Custom AMIs