Introduction to AWS and it's services      EC2, LAMBDA, Elastic Beanstalk

Introduction to AWS and it's services EC2, LAMBDA, Elastic Beanstalk

Part -1 of AWS blogs

Hey guys, welcome to MyDevOpsJourney😄

I'll have to apologize for taking some extra time to publish my blog on AWS due to personal work. Anyways in this blog, I'm back with some amazing content on AWS which will be published in different parts because it's too lengthy and can take more than 5000 - 6000 words to publish in a single blog which is not possible to do tho.

Please read the whole blog and please let me know in the comments if you liked it.

Let's get started

Before diving deep into AWS concepts, let's first roll back to a decade or even more.

What was the situation before Cloud?

To host a website you have to buy a stack of servers which is very expensive as we know. And another concern is that since the network traffic varies, servers will be idle most of the time. So, you end up paying more money for the servers than you should. Maintaining and monitoring are major problems too.

The answer to your first question is below

What is Cloud?

We all know that everything’s now going online like we shop online, we study online, we order food online like we get almost everything online which means we have lot of data that’s being generated these days which is called digital data.

Since everything’s moving online the amount of data is very huge and for that, we need a space where we can maintain the data no matter what huge size it is.

So all these issues like costs, monitoring, providing sufficient space, etc are taken care of by Cloud.

Cloud lets you rent the services that you need and use only those services that you need so that you can save lot of money because you pay only for the services you use.

What is Cloud Computing?

It’s a place where you can store your data. You can process it and you can access it from anywhere in the world.

Suppose you decided to choose a region for your infrastructure somewhere in the US, you can sit in India and you can still have access to all your resources that are there in the US. And that is what the Cloud does.

Types of Service models

  • IaaS (Infrastructure as a Service)

  • PaaS (Platform as a Service)

  • SaaS (Software as a Service)

Deployment Models

These are the different types of clouds present in the market.

  • Public Cloud - available all around the world

  • Private Cloud - only for a limited number of hosts behind a firewall

  • Cloud - combination of public and private

Cloud Providers

  • Amazon Web Service(AWS)

  • Google cloud platform

  • Microsoft Azure

  • IBM Cloud

  • Terremark

  • Digital Ocean

Aws is 6 times larger than all the service providers in the market

So, we'll dive into the main topic of the blog

What is AWS?

AWS - Amazon Web Services

It is a complete software suite or a cloud service provider which is highly secure. It offers compute power, database storage, content delivery and other functionality to help business scale and grow.

Aws has various reasons to be the best in the market. They are:

  • Flexibility - Manages huge amounts of data

  • Cost Effective - charges you only for the time and services you are using

  • Scalabilty - gives the freedom to scale up and scale down depending on the data that you want to use

  • Security - it has great security mechanisms

AWS Architecture

Amazon infrastructure is divided into the following categories:

Regions & Availability Zones

Regions: Regions are nothing but different locations around the world where they have their various data centers put up.

1 Region has more than 1 datacenter which are called Availability Zones.

Domains of AWS

  1. Compute:

    When you talk about compute the first thing that should come to your mind is EC2(Elastic Cloud Compute)

    EC2: It lets you have a resizable compute capacity. It's more of a raw server where you can host a website.

    Elastic Beanstalk: It lets you deploy your various applications on AWS. You don’t have to worry about the underlying architecture. It's very similar to EC2.

    Suppose you want to use Java as far as EC2 goes you’ll have to install everything from the beginning and start fresh but as far as Elastic beanstalk is concerned it has the predefined libraries you can just go ahead and use those because there’s an underlying architecture which is defined.

  2. Migration:

    Aws has a global architecture so there would be a requirement for migration.

    Aws lets you have physical migration as well which means you can physically move your data to the data center which you desire.

    Aws has Snowball which is a storage service that lets you move data physically.

  3. Security & Compliance:

    There are many security services like IAM & KMS

    IAM - Identification and Authentication Management tool

    KMS - which lets you create your own public and private keys

    that helps you keep your system secure

  4. Storage:

    There are many storage services like S3, Cloudfront, Glacier, etc

    S3 - works as a bucket object kind of a thing where your storage place is called a bucket and the object which you store is nothing but your files.

    Cloudfront - a content delivery network

    Glacier - you can think of it as a place where you can store archives

  5. Networking:

    There are many services like VPC, Direct Connect, Route 53

    VPC - It’s a virtual network that lets you move or launch your resources

    Direct Connect - a least internet connection that can be used with an Aws

    Route 53 - it’s a DNS

  6. Messaging:

    We have AWS Usher’s secured messaging and quite a few applications to take care of that as well.

    We also have Cloud trial and ops works they help you in communicating with other parties.

  7. Databases:

    Storage and databases seem similar. But, there’s a difference:

    Storage is where you store your executable files

    For databases we have Aurora is very sql-like which lets you perform various SQL options at a much faster rate.

    Amazon claims that Aurora is 5 times faster than Sql.

    We also Dynamo DB which is a non-relational dbms.

  8. Management Tools:

    We have Cloud watch which is a monitoring tool which lets you set alarms.

That's it for the basic understanding of AWS.

Setting up AWS account

AWS provides you with its free tier which is accessible to you for 12 months and there are quite a few services that are available for free with certain limitations.

Note: As long as you stay within the limits that AWS has set you won’t be charged anything. For learning purposes, it’s more than enough.

Check out this link for AWS free services.

For setting up AWS free tier account click here

Now Let's understand some of the services offered by AWS

EC2

What is an Instance?

An instance is a virtual server for running applications on Amazon’s EC2. It can also be understood as a tiny part of a larger computer, a tiny part that has its own hard drive, network connection, OS etc. But it is actually all virtual.

Types of Instances:

1. General-Purpose Instance:

This is used for applications that require a balance of performance and cost. That means where you need a quick response but at less cost and less processing too.

Example: An E-mail Response system has many emails to reply and deal with like n number of emails but response should be very quick and cost-effective at the same time.

2. Compute Instances:

These are for applications that require a lot of processing from the CPU.

These are very helpful where there is a lot of data and need quicker computation power because they have better computation power.

Example: Analysing Streaming Data

You are streaming a youtube video live and to process this kind of data which is continuously flowing in and out we need systems that have very good computational power.

3. Memory Instances:

These are for applications that require a lot of RAM(memory).

These Instances serve applications that need Multi-Tasking and Multi-Processing.

4. Storage Instances:

These are for applications that are huge in size or have a dataset that occupies a lot of space

5. GPU Instances:

These are for applications that require heavy graphics rendering.

What is EC2?

Amazon Elastic Compute Cloud, EC2 is a web service from Amazon that provides resizable compute services in the cloud.

EC2 is one of the oldest AWS services.

What does Elastic Compute cloud mean?

It’s a service that lets you carry out computational practice and elastic means it's resizable and reusable.

EC2 Instance Pricing Models

On-Demand - It’s an instance when you demand then you get it. These instances are made available to you for a limited time frame.

It is similar to renting a car for 1 day. When the day is complete you must return the car. And you will be charged for a day only.

Dedicated - These instances are given to only particular organizations so that their security is defined better than others.

They are expensive but give you a higher security like isolation from others.

On Spot - If you are dealing with data that is volatile and you want to work on that data in real-time. You can opt for this instance because after a while the price of this instance might change and this instance might be terminated and you might not be able to use it for a longer while. It’s available at a cheaper price and at a pricing bid that you put on it.

Reserved - It's like renting an apartment on lease for a longer period. You have a fixed rent for that whole period. If you take for a longer period you might end up paying a lesser amount.

EC2 Instances based on their Functioning

Burstable – If you want to utilize your CPU for a certain amount

Suppose, I need a CPU utilization of 20% I can go for burstable instances. Initially, they start with the functioning of 20% and in case my website experiences more traffic these instances burst out their current performance at 100% CPU utilization so that you can get more performance.

Now what happens here is you are charged a particular amount for these instances and you have certain credits for which you can use the burstable performance. If you don’t use burstable performance, those credits can be used later.

So, you are getting optimized performance and saving some money as well in case there is an urgent traffic experience.

EBS Optimized – These are the applications where you process the data at a higher speed. They give you input and output processing.

Cluster Networking – They form clusters of instances.

Suppose in my application I have different sections and my first section requires processing data at a faster rate and the other one I wanted it to be storage optimized. So I can define different clusters of instances that serve different purposes.

Let's see some Use cases which could help us understand different instances

Use-Cases

Analysis of customer’s data - Burstable

Auto Response E-mail System – EBS Optimized

Search Engine & Browsing – Cluster Networking

Confidential Data Processing – Dedicated

For creating an EC2 instance click here

AWS LAMBDA

AWS Lambda is a serverless compute service which means you don’t have to choose the server. It’s like you just upload a code and it executes the code, it’s that simple.

To put it in a much clear way:

  • Automated version of EC2

  • You can only execute background tasks

  • Cannot deploy an application

  • Depending on the workload the server configuration is assigned

You can use the service using the software development kits(SDKs) which are provided by AWS.

AWS SDKs

One can simplify using AWS services in your applications with an API tailored to your programming language or platform.

AWS SDKs are basically APIs that are defined for specific programming languages.

These APIs can be integrated with an IDE and thus can be used with ease.

For Deploying an application using Lambda Function, click here.

Amazon Elastic Beanstalk

AWS Elastic Beanstalk is a PaaS service used for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js etc on familiar servers such as Apache, Nginx, Tomcat, and IIS.

Advantages

  • Quicker Development

  • Simplifies Operations

  • Cost Effectiveness

  • Multi-Tenant Architecture

  • Better User Experience

Features of AWS Elastic Beanstalk

  • Elastic Beanstalk is the fastest and simplest way to deploy your application on AWS

  • Enables you to focus on writing code rather than spending time managing and configuring servers etc.

  • Automatically scales your applications up and down based on application’s specific needs

  • Gives freedom to select the AWS resources like EC2 instance type, that are optimal for your application.

Components of Elastic Beanstalk

  • Elastic Beanstalk reports the health of a web server environment depending on how the application running in it responds to the health check.

  • Different colour shows the status of the application

  • Grey – Environment is being updated

  • Green – Passed recent health check

  • Yellow – Failed one or more checks

  • Red – Failed three or more checks

Architecture of Elastic Beanstalk

When you try to launch an Elastic Beanstalk environment, Beanstalk asks you to choose between two different environment tiers.

1. Web Server Environment:

This tier handles HTTP requests from clients.

  • Beanstalk Environment – It is the place where the application runs. We can also create multiple environments. At a time this environment can run only one version of your application.

  • Elastic Load Balancer - It distributes all the requests among different EC2 instances so that all the requests are handled and no requests is denied.

  • Auto Scaling Group - Automatically installs or terminates EC2 instances based on traffic.

  • EC2 instance – Beanstalk will assign your application to a suitable EC2 instance.

  • Host Manager – it will provide you with a detailed report regarding the performance of your application. It provides instant-level events. It monitors your application log files and many more.

  • Security Groups – It's like a firewall to your instance. Elastic Beanstalk has a default security group that allows clients to access your application using port 80.

2. Worker Environment:

What is Worker?

- A worker is a process that handles background tasks during resource-intensive or time-intensive operations.

We can use worker to send email notifications, generate metric reports and also to clean up databases when needed.

How these two environments communicate?

Explanation:

When a request is made to the Web Server by a client, the server is encountered with time-consuming tasks and it passes the request to SQS(Simple Queue Service) and while installing the Worker environment Daemon server pulls the tasks from the SQS queue and this daemon sends all the tasks to your application on port 80. The application resolves all the tasks and then it responds with a HTTP response.

For deploying an application using Elastic Beanstalk click here.

That's it for the blog guys. I hope you enjoyed the reading and learned something useful.

Next few blogs will also be on AWS's different services.

To Contact me:

Twitter: https://twitter.com/Chris__Jonathan

LinkedIn: https://www.linkedin.com/in/chris-jonathan/

Thank you guys😊