Handling Traffic

AWS offers Route53 for DNS and related services. ELB optimally distributes load between your EC2 instances.


Route53 is a DNS Service that provides a reliable and scalable way to route traffic. DNS maps IP to a domain name. Key features:

  • global, highly available DNS
  • domain registration
  • public and private names
  • multiple routing algorithm
  • both IPv4 and IPv6
  • integrated with other AWS cloud Services

To setup:

Amazon Storage Options

Amazon offers a few storage options:

  • File Storage - use EFS
  • Block Storage - use EBS and EC2
  • Object Storage - use S3

EFS works very much like your computer's directory structure. All files are classified hierarchically and each has a unique address which is used to retrieve it. Block storage is mostly used by software. Object can be any raw data such as an image, text file, pdf, etc. Objects are non-relational and unstructured. Each object has a unique id. This id is used to retrieve the object. REST API can also be used to access objects.


Autoscaling ensures that you have the sufficient AWS EC2 instances available to handle the load and it also ensures that you don't have more instances allocated than you require.

The load on a server fluctuates over time. Autoscaling allows you to allocate more EC2 resources when you need them and retire them when you no longer need them. You can either manually define peak and low-peak times or you can define rules based on CloudWatch alarm that automatically allocate and retire resources as needed.

How to access AWS Cloud

There are 3 ways to use AWS:

  • AWS Management Console (GUI Interface)
  • Command Line Interface (CLI)
  • Software Development Kits (SDKs) - enables access using other tools

To access the console, go to http://aws.amazon.com/console. Login and you will see a list of resources and services you can setup and configure.

CLI interface allows you to access AWS through your terminal window. See AWS CLI to learn how to use it. Example command:

aws ec2 describe-instances

Connect to Linux Instance using SSH on AWS EC2

  1. Go to (http://aws.amazon.com)
  2. Sign in
  3. Click on EC2
  4. Click on Running Instances
  5. Select you pem key. It should match the key pair name.
  6. Make sure that the pem key has "chmod 400" permission
  7. Open terminal and type: ssh -i mykey.pem username@public_dns_name

username is: - ec2-user for Amazon Linux - ec2-user for RHEL5 - ubuntu for Ubuntu - ec2-user for Fedora - ec2-user for SUSE Linux

Introduction to AWS

What is AWS?

Amazon defines Amazon Web Services (AWS) as "a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow".

What is cloud computing?

On demand delivery of IT resources and applications via the Internet

Resources on cloud

With the traditional model, you need to procure sufficient hardware, bandwidth, and human resources to run the IT infrastructure. Your infrastructure is fixed and financed.

Python3 with MySQL database

If you don't already have MySQL installed, install it with the following commands (mac only):

$ brew info mysql
$ brew install mysql
$ brew tap homebrew/services

Run the following commands to start or stop mysql. Start MySQL before proceeding:

$ brew services stop mysql
$ brew services start mysql

To see available sevices:

$ brew services list

To check MySQL version:

$ mysql -V

Set root password