Building a modular web application with python flask, Angular, and AWS : Part 5 Working with AWS introduction and why we should take advantage of a cloud platform

In this part I’ll ask you to do some independent learning to go out and set up an Amazon AWS account, so in the next part we can go out and take advantage of all the amazing cloud services amazon has build up and shared with the development community.

There are a couple reasons I really like AWS and that’s how much support they actually give developers as part of the putting the customer first policy by creating technology as a platform as they continue to innovate in their own business.  Also AWS has very flexible pricing options based on the scale of your service, they give a lot of great low maintenance features such as data replication and build in query caching with DynamoDB nd very cheap object storage in s3 with in depth versioning and logging if you chose to utilize it.  Now I’m not here trying to sell you on S3, you can create a free tier account for one year with enough functionality to continue this tutorial easily from https://aws.amazon.com/free/ and if you decide you don’t want it after that just cancel it.  I’m bringing those features up because as a developer having tooling that can help us meet customer and client demands quickly yet effectively and product the needs of both should be even more important to us then code quality.  As much as we want to reinvent the wheel being able to utilize abstractions that already exists is what enables us to drive the advancement of technology and the less time we have to worry about what happens if our database goes down or building up your own load balance to distribute requests against your 5 linux blade servers you set up yourself while paying for a T2 connection, will be more time we can actually make cool stuff.

 
Now that I got that out of the way head over to aws and make a free account.  They will ask for a card but that’s only as a precaution, if you continue following along with me then we’re not going to do anything you’ll actually get billed for, but we will learn some of the most important parts of AWS for simplifying web development.

As you do that I’ll cover the services we will be using:

IAM – Identity Authentication Management service for creating users and handling permissions to what those users can do

DynamoDB – A very scalable nosql database based on key-value collections with grouped keys.  My experience with dynamo is pretty limited so I can’t promise I am teaching best practices but can at least give some good pointers on things to consider for you database design. Please comment if you have better ideas and I’ll gladly give credit and make a correction article but I’ll research the stuff as we’re going along.

S3 – Amazon’s Simple Storage Solution which is great for storing all types of files, we will use it for images.

Elastic Beanstalk –  This one is completely new to me and I’m bound to mess some things up  but this service is used for hosting all kinds of web application solutions from our python flask app we are developing now to NodeJS, which I will be doing a tutorial series for next with Angular4.

Other key services we may or may not get into in this series but are definitely worth knowing about:

AWS Lambda: Allows for highly modular pieces of code that can be ran with http requests on the fly. I don’t know all of the best use cases for this but I do know it is used for making Amazon Alexa Skills and can also be used for complete abstract CRUD, create read update delete, on Amazon RDS or Dynamo DB.  This is something I definitely want to learn more about but haven’t been able to think of a use case where I’d really get advantage out of the cost savings it may provide.

Route 53 – This is Amazon’s DNS system that can be used to assign a url to your web application.  So instead of pythonflask.aws.amazon.com we can get www.ComSciUPythonFlaskApp.com because who wouldn’t want such an awesome domain name.

EC2 –  This stands for Elastic Cloud Computing and allows you to create small virtual instances in the cloud and a choice of what services you want to deploy on these such as databases, web servers such as Apache or Nginx, etc… You can spin up a huge 32 core instance with 100gb SSD and 512gb of Ram for running highly parallel machine learning training and tear it down when you are done for several dollars an hour if you wish, and reminder to tear it down because the monthly cost on those are HUGE.  Or you can spin up a small 2 core, 2gb of ram instance and run a small Python Flask application and scale it as your user base grows. We could also go this route for hosting our application but I’m more interested in using this as a chance to learn elastic beanstalk as I know the whole EC2 model from my work.  I’ll do the compare and contrast for the two during that section when we get there.

Seeing as how much writing this ended up being I’ll use this as a wrapping up point to let you explore more into some of these services we will be using.  They are all heavily documented with tons of great tutorials and examples.

Next article we will use the IAM service to create a development user who can read and write to dynamo and s3.  We’ll generate a access key and secret key pair for the user so we can access our AWS services programmatically from our python flask application, we will create our users table in a modular system to allow easily replicating our schema between our dev and prod instances, and set up some pytest to keep our code tight and think about our code methodically to put a little more weight on initial design to save us time towards the later part of a project.

Leave a Reply