Autoscaling

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

Python3 with Oracle database

Installation

These instructions are for Mac OS:

First install homebrew. Never use sudo for brew.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ which brew
/usr/local/bin/brew

Install Python3. The installation comes with pip3.

$ brew install python3
$ which pip3
/usr/local/bin/pip3

Install cx_Oracle, the library that allows python3 to communicate with Oracle database.

What is Caching

A cache is a temporary data store that usually contains pre-computed data. The purpose of a cache is to provide the data the next time someone asks for it without having to re-compute the data. For example, your website needs to run a complex query to fetch results of a user request. A complex query takes time to run and uses the system's resources for the query to run. Every time someone click on a link, this query needs to run. However, if you cache the results, you can simple provide results from the cache rather than having to re-query the data.

Quick Introduction to Google Cloud

Google Cloud Platform (GCP) offers many services. They can loosely be classified as:

  • compute services
  • storage services
  • big data services
  • identity and security services
  • management tools
  • developer tools
  • other services

Compute services includes virtual machines, containers, and functions.

Storage services allow storage of files, archival storage, and persistence data. Data services include NoSQL, RDBMS, Hadoop and Spark.

Pages