Monday, August 31, 2015

Amazon Web Services: Virtual Private Cloud

In this blog, we will discuss Amazon Web Services,Virtual Private Cloud (VPC)

 Please have a look at the diagram below:

Customer 1 (C1), Customer 2(C2) and Customer 3 (C3) have their EC2 instances. Without VPC, C2 can ping and try to access easily C3 s EC2 instances.

VPC Benefits:

  • Logical isolation of your resources from other customers, from internal divisions and application tiers.
  • Control Over:
          --Address Spaces
          --Subnets: Do you know minimum size of subnets should be /28 or 14 ip addresses and maximum size should be eual to size of VPC. We can have 200 Subnest per AZ
          --Route Tables and NATs
          --Network Gateway (VPN and Internet)
          --Ingress and egress security groups
          --Multiple Elastic Network Interface (ENI) on VPC EC2
          --Control over dedicated hardware

VPC Limitations are:
  • Only Select resources like ELB( w/support to balance web/app tier), EC2( and EBS, Autoscaling), RDS, Elasticache can be launched in a VPC
  • You will want to launch all of them together either inside or outside VPC
  • No multicast or broadcast support
  • 5 VPCs per account per Region
  • 200 subnets per VPC
  • 5 vpc eip per account per region
  • 1 internet gateway per VPC
  • No. Of ENIs per instance depend upon type of instance

VPC Setup:

  • Create VPC: Choose reaonable IPs
  • Creeate Subnets
  • Create route tables, NACLs
  • Launch assets into VPC
  • Create IG.VPG

So this is the basic understanding of VPC

Thursday, August 27, 2015

Amazon Web Services: ElastiCache

In This blog we will discuss Elastic Cache

ElastiCache is the in memory caching mechanism. It is the memcache under the hood. It is 100% API compliant.More appropriately it is a memcache cluster

Memcache is a popular , opensource in -memory cache. it is  very fast read and writes.It takes burden of backend resources

Memcache is a key value store.It is a NOSql DB. Its only access method is a key

ElastiCache is actually a memcache cluster. it is a distributed collection of cache nodes

Its available in only Single AZ
Cache nodes are very user specified types
  • very much like EC2 Instance type
  • can be wrapped with security groups
  • can buy capacity reservations
  • Resizeable ( remove or add nodes)

To Setup and ElastiCache

  • Choose an AZ
  • Chose node types, # of nodes
  • Launch Cluster
  • Connect application by pointing to elasticache endpoint
  • Benchmark, resize ( if necessary)

Elasticache Expiry
  • Expiring Key is controlled via the elasticache API (memcache commands)
  • Scheduled
  • on demand

ElastiCache Pricing
  • It has per hour node charge
  • Bandwidth Charges- Bandwidth Charges are free inside the AZ but Charged $0.1/GB in or out of AZs

Wednesday, August 26, 2015

Amazon Web Services : CloudFront

In this blog we will discuss amazon cloudfront. What is cloudfront?

Cloudfront is a CDN or content delivery network. It utilizes Edge Locations near to user. Since its a CDN we need to remember content needs and origin and it can be expire also.

CDN are popular static websites.Using CDN, you can either make

  • Download distributions like products, documents and data
  • or Streaming distribution like audio or video
Cloudfront has native integrations to AWS (S3 origins).It is very cost effective

To setup a cloudfront, one must create a distribution
  • Must define Http or steaming
  • Must Specify an origin: Any web accessible server will work ( EC2, S3, Private server)\
  • Can also specify TTL, logging, Path matches
  • Distribution domain created for you for example like or can also easily create vanity URLS
Use Distribution domain in links

When user access the CDN URL, Cloudfront directs them to their closest Edge. Everyone loads content faster.

Cloudfront is a pull mechanism.Each edge pulls from origin if it doesnt have the requested content
Each Pull is charged
  • from origin
  • from each user
Invalidation request are charged.
But you can get Reservation capacity discount if you know your load in future and you reserve in advance.

Tuesday, August 25, 2015

Amazon Web Services: Storage

In this blog we focus on Storage. We will discuss many storage options available in AWS.

So we will look at S3 Storage, RDS( Managed MySQL, Oracle and SQL) and DyanamoDB( NOSQL database)

Lets start with S3 Storage.

S3 Storage ( Simple Storage Service) is an object storageand is best used for static assests. It is the cheapest option to store and serve data. There is no limits on the number of the objects that you can create. It is extremely durable.

S3 is extremely scalable too. All objects are natively web accessible.It can also host static websites.

There are certain S3 limitations:

  • Latency
  • Its a WORM ( Write Once Read Many) Storage.
  • It cannot serve Dynamic content
  • Its 100buckets and 5TB Max sizeon the objects
  • bare bones (write, read, delete)

RDS ( Relation Database service) is a hands off RDBMS (MySQL, Oracle and SQL). RDS is manually scalable like EC2. RDS has HA already baked in ( multi-AZ master/slave). RDS also has DR baked in with automated backups and real time snapshots. It is very cost effective. It is also very scalable.

RDS has some limitations too. It has upward vertical limitation. RDS has 3TB max db size.It has only SQL Interface with No SSH or hardware access.

DyanamoDB deals awesomely with 3Vs of big Data( variety, velocity and volume). It has HA baked in. It is highly scalable and cheap. It has drop dead administration

Sunday, August 23, 2015

Amazon Web Services: Cloudformation

In this blog, we will discuss Cloudformation.
cloudformation helps in codifying creation of stack of resources.

What are stack of resources? A stack could be:

  • ELB
  • Auto scaling group
  • EC2
  • RDS (Database)
  • All connections between them

There are many benefits of cloudformation, namely:

  1. Your infrastructure as a code
  2. can be version controlled
  3. Modularization ( templates can contain other templates)
  4. Enforce one way to deploy
  5. Cost nothing
Signing up with Cloudformation means signing up with AWS services that Cloudformation can create

With Cloudformation you can setup billing alarms. To learn how to setup billing alarms go to

There are 200-300 pre-packaged amazon templates available. The templates are JSON based. The templates can accespt run-time parameter [Instance type (small for test), Kep pair (prod vs Test)]
Templates can also update running stack
Templates have 7 section
  • version
  • description
  • parameters
  • mapping
  • resources
  • properties
  • output
The link for templates is

Friday, August 21, 2015

Amazon Web Services: Auto scaling and Cloudwatch

 In this blog, we will discuss Amazon Web Services: Auto scaling and Cloudwatch

The question is : What does Auto scaling provides?  The answer is:

  • Linear Horizontal Scaling 
  • HA

Second question is What Cloud watch enables? Cloud watch enables:

  • monitoring and alerting for resources
  • Alarms Can fire auto scaling policies, SNS notifications

 auto scaling, ELB and Cloud watch makes up what Amazon calls Triangle services


To set up Auto scaling, we need to do the following things:

  • Create ELB( Its recommended but not necessary)
  • Create Instances in 2 or more AZs ( Its recommended but not necessary
              a) Create Launch Config: Launch config consists of
                          1) EC2 instance launch profile
                          2) Image ID (AMI)
                          3) Instance Type ( e.g t1.micro or m1.small)
                          4) key pair ( recommended)
                          5) Security Group
                          6) Name

  • Create Auto scaling Groups: In a auto scaling group you have AZs, Max or Min servers etc
  • Create Auto scaling Policy: The policy consists of buttons that an API/Scheduled/ cloudwatch can push
  • Create Cloud watch Alarms: Which can fire policies


Now we will briefly discuss cloud watch. So what does Cloud watch exactly do? Well, the answer is
  1. Monitors/Alarms on resources
  2. Basic Monitors provided free with most basic services ( EC2, ELB, SQS..etc)
  3. Alarms can fire auto scaling policies or SNS notifications
  4. cloud watch is statistics in , statistics out. below is an example

Cloud Watch alarms trigger when metric statistics goes in( or out  ) out of state for specific time

Hope it clears the functionality of cloud watch

Thursday, August 20, 2015

Amazon Web Services- Elastic Load balancer

In this Topic we will discuss Amazon Web services ELB or Elastic Load Balancers

So first question is : What does Load balancers Do?  The answer is:

  •  Send Traffic to many Back-end Servers
  • Attempt to evenly distribute load
  • Allows yours service to be elastic
  • It allows for Horizontal Scaling
  • Grow and shrink on demand

Horizontal Scaling by the ELB in the cloud gives us:
  • Near Infinite Scaling
  • Huge cost savings
  • High Availability
  • Scaling By Tier
So what is Scaling by Tier

We can scale up or down web tier independent of APP Tier. This sis called scaling by tier

ELB Auto-scales ( Adds more IPs with increased traffic to the DNS)

ELB can also Terminate SSL, encrypt SSL to the back-end Machines

ELB also supports X-Forwarded-FOR

ELB has deep Integration with Auto Scaling and Cloud watch

Integration with Auto Scaling and Cloud watch

ELB can detect unhealthy Instances
  • Unhealthy by TCP or HTTP check
  • It automaticvally removes them dfrom scaling

However, Cloudwatch can add more instances behind ELB
  • Based on ELB metrics ( RequestCount, Latency and More)
  • Based on Instance Metrics (CPU. I/O, etc)

  • Load balanced is first by Availability Zone
  • Then across instance in availability zone
  • ELB cost is static
  • ELB scaling is always reactive

Featured Post

Amazon Route 53

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service.Route 53  perform three main functions in any...