Back to Top

Getting started with Amazon Web Services

Getting started with Amazon Web Services

Amazon provides a lot of services so it is difficult to cover everything in one article but I will try my best to cover in this article.Basically,AWS is a subsidiary of Amazon.com which provides cloud computing resources and operates in 12 geographic regions and makes the on-demand computing platform that is offered by AWS.

What is Cloud?

Cloud computing is a kind of virtual computer. Cloud computing in layman language is whatever application and resources you are going to use, you only have to pay for those resources.

Cloud computing is not restricted to certain domains nowadays, you can use cloud computing for anything. After the introduction to IoT, cloud computing penetrates to everywhere because it just not related to IT-related things but can be anything.

Cloud computing is basically everything about AGDT as it is flexible, on-demand and you can restrict the code, you can use when it needed. All things you can easily achieve through Cloud computing.

Let’s take the example of Google and Facebook have heavy traffic, before cloud computing, it was very difficult to handle such traffic in the past but now with cloud computing, it is very easy to manage heavy traffic.

Agenda of this article:

Overview of AWS
Global infrastructure
A comparison
Compute
Storage
Database
Networking VPC
AWS calculator

An Overview:

Amazon Web Services (AWS) is designed to use AWS cloud services.AWS packages are free for 12 months from the registration. Amazon Web Services provides cloud computing solutions for online marketing business which provides a flexible, scalable and highly resilient, low-cost content delivery mode. AWS is a virtual machine-based platform for a web application framework where you can run on a variety of operating systems and services.

Global Infrastructure:

Region: A region is a separate geographical area and inside a region there are multiple availability zones and they are isolated with each other and connected via low latency links.

Availability Zone: There are multiple availability zones inside a region. In case of failure of a particular availability zone, the service can operate from another availability zone. It’s basically an isolated location within a region where the data center is hosted.

On Premises vs AWS Cloud:

The question is why do you shift to AWS cloud? Now when we compare on-premises vs AWS cloud, In terms of cost ownership, we can see various parameters here where cloud can optimize the customization and implementation. We don’t have to worry about the maintenance and training part. So, these are the various parameters where the AWS cloud handles. We can see that we don’t have to worry about 77% maintenance than the on-premise services we are operating now.

It offers a range of services like Compute Services, Storage Services, Network Services, and Database Services.

Compute Services:

EC2 (Elastic Compute Cloud):

It provides the facility to host the Virtual Server which is called Instance in terms of AWS language. It provides support to deploy your services on Windows, Linux, FreeBSD, and OpenSolaris.It also provides replication of data availability zones. EC2 Keep track and monitor data usage.

ASG (Auto Scaling Group)

Scale your EC2 instances automatically. No additional charges required. It is used by applications which ELB experience variability usage. It measures the CPU utilization at every instance and one reached the threshold, it will automatically create the new virtual server.

ELB (Elastic Load Balancing)

ELB supports load balancing in various EC2 instances. It seamlessly integrates with auto scaling group(ASG) so whenever a new instance launches by ASG, it will automatically route the traffic to the new EC2 instance.

Next, We are going to talk about the Storage services of AWS.

Storage Services:

S3 (Simple Storage Service)

  • It’s an Object based storage.It provides 99.9% durability of objects.It gives free storage up to 5TB size per project.
  • Well known and various enterprise like Dropbox are using S3 for storing the data.
  • It supports Multipart upload improves throughout.
  • Lifecycle management for achieving old objects. If you want to delete or archive object, you can manage it here through various lifecycle management tool.
  • Enable versioning.
  • Serve static content as a website.

EBS

  • It provides Persistent block storage.
  • You can bound it too easy to instances like to give an analogy, hard drive in laptop similarly you can use the hard drive for EC2 instance.
  • AWS provides various database Services, let’s understand those services now.

Database Services:

RDS (Relational Database Service)

  • Database engine: MySQL and Oracle 11g,postgreSQL, MariaDB.
  • Backup the data so you don’t have to spend more time in maintenance of data.
  • Scalable
  • Fault tolerance

Dynamic DB

  • NoSQL database. You don’t have to write SQL queries.
  • Fast predictable performance
  • Scalable
  • InExpensive
  • Easy to manage

Networking Services:

VPC (Virtual Private Cloud)

  • Logically isolated networking services: where you can logically isolate the networking services and launch your own cloud in VPC.Customize your network configurations that are where you can create IP address and subnet to customize the network configurations.
  • Multiple Connectivity options: If you want to public or private VPC , you can create through multiple connectivity options.
  • Secure: It is more secure and also you can manage cost.

AWS Calculator:

Demo

These are the basics services of AWS, they are many more services offered by AWS like mobile services, analytical services, notification services, and development tools, etc.

CICD(Continuous Integration and Continuous Deployment)

This is service is not very new to the world. This is also known as DevOps(Development Operations) tool.

Whenever you write a code and pass to the QA and move to stage server but there is something not work on the server and in that there would be some downtime to solve the issue on the server. But if you have seen larger companies like Google and Facebook, they don’t have downtime while deploying any new features to the server. For that, CICD is useful and it solves the issue of downtime.

Let’s understand the process of CICD:

Over Process:

overprocss-cicd-aws-service

First, you are deploying to the development server. Next to the test server and then to the staging or preproduction server. if all works fine, deploy the code to the Production server.

The first stage is called the Development so you need to manage the codebase because a couple of developers are working on the development server so you can use the versioning system(Exa, GitHub, SVN) for that. Every developer can download the code and commit the changes when required.

The development server is in a local environment and other servers are on the different servers so sometimes the path of images or templates are different and you need to change after the deployment which may go the server in maintenance mode but CICD reduces that time too.

The staging server is identical or mirror copy of the Production server so the purpose of staging is if any bug found on a production server, first debug the issue on a staging server, try to fix that issue over there and deploy the same code on production. You can also test the user capacity and usage testing on staging server. Doing something directly to the production is not good so better to use the staging server.

Once your code tested on staging, You can move code to the Production.

Overall Process of CICD

release-process-phase-aws-service

Release process has four major phases:

First, come to the source, Source is the source files, this may be JAVA, PHP, etc files and also peer review the code and next is the build to prepare the code to deploy, you can do unit testing when you build actually. You can also build containers and images with the help of tools.

After that, Test stage and perform the all type of testing like functional testing, integration testing, load testing, penetration testing everything and make your code ready to deploy. Once it will pass everything, deploy to the Production.CICD helps to write a proper workflow to handle everything automatically.

So we can say this is the overall process of CICD. The next topic is the CICD levels.

CICD Levels:

Let’s understand the release process levels in CICD.

cicd-release-levels-aws-service

Let’s understand the final three very important terms:

  1. CI (Continuous Integration) – Building code base according to deployment
  2. CD (Continuous delivery) – Delivery up to the test
  3. CD (Continuous Deployment) – Deployment of the code in production

So These are ultimately three terms for designing your application, designing the database also important in CICD. CICD will have less or no downtime as everything will be automatic. It is not easy at all to build this kind of system. You might need to use some tools you build this type of system.

Let’s understand some tools useful to build CICD application.

Overall Development Stages

Development: Development environment can be anything. You can use any Operating system. Based on the development environment you have different builds.

Version System: You can use any versioning system like GIT, SVN, Code commit, etc. Code commit is nothing but GIT of AWS. The code commit is cheap in price.

Build: You can use the tool called Jenkins for the build. Jenkins is a tool used to create a magic. You can use Jenkins for any technology like JAVA, PHP, PYTHON. However, the build process will be different on technology. You can use PHING for PHP project build system and Maven to build java application.

Deploy: Finally, deploy your code. Once Jenkins provides builds, you can deploy your code and Code deploy tool helps to deploy your code easily to the server. Code deploy is an amazon integration service and it’s a free service. Code deploy has very simple utility tutorials and the best part of Code deploy is reverting back. If something goes wrong, you can easily revert the code.

Only code deploys, Jenkins or version system does not work to build CICD process. It will work together and create a CICD environment.

CICD Basic Demo:

Component we are going to use:

  1. Repository GITHUB
  2. Jenkins build tools
  3. S3
  4. Code deploy

These are the things we are going to use,Repository is GitHub, Jenkins is a build tool,Jenkins will copy code to the S3 whereas S3 is used to zip or xml the file which helpful for build the code(profile) and code deploy will deploy the code.

Here, Create a two profile, one profile for staging and a second profile for production. Once I select a staging profile, it will convert the codebase at a time of build according to the staging server. After testing, I can select production and deploy the code.

Integrated Jenkins for automatic deployment for GIT so whenever push the code, it will automatically deploy the code. It will automatically detect the changes when to commit the code and understand the new code and create the build and once the build is successful, Jenkins automatically deploy to the production server.

AWS Lambda:

AWS Lambda is a code as a service. It is basically microservices. AWS Lambda is one of the best services compare to any other service of the amazon. It is number one researched in the World and as a developer, it is a very useful service for us.

What is Lambda?

AWS Lambda is a zero administration compute platform for backend developers that runs code in the AWS cloud.AWS Lambda is a compute service. You can set up AWS Lambda functions to respond to events asynchronously.

Let’s take some basic use cases where Lambda comes into the picture. Suppose you are running a scheduler for every application and Scheduler is taking backup of the file at regular intervals. If any user uploads an image, an image will be compressed, the thumbnail will be created so you can manage through the scheduler. Now if you have a limited set of users like 12 or 15 users at that time, you can easily manage. But if you have more concurrent users like 500-1000 users, it would be easily handled through the AWS Lambda, you can write image compression, thumbnail generation code in Lambda and keep it there and create an event which will perform the operation when to trigger through Lambda configuration.

So, Server resources will be used to perform other operations on images for all concurrent users, You can manage all things through Lambda, if you have 500 users, 500 lambdas will be used. It will dynamically use the compute resources, RAM and required amount of space, CPU and once everything was done, release the resources which can save your resources, server cost, maintenance cost etc.

AWS Lambda can use as follows:

As an event-driven compute service where AWS Lambda runs code in response to events like change data in an Amazon S3 bucket or an Amazon dynamo DB table.

As a compute service to run your code in response to HTTP requests using Amazon API Gateway or API calls made using AWS SDKs.

Programming languages AWS Lambda support:

AWS Lambda is CAAS (Code as a Service) where no need to host your code, no need to give specific hardware, Lambda will decide hardware at the runtime and compute the code. It will never down and if your server is down, it will be handled through microservices.

AWS Lambda supports following languages.

  1. Node Js (JavaScript)
  2. Python
  3. Java(Java 8 compatible)

You can set email, SMS and push notification, etc you want to set up through Lambda.

Where is AWS Lambda running code?

AWS Lambda runs your backend code on its own AWS compute fleet of amazon Elastic compute cloud(EC2) instances across multiple availability zones in regions, providing the high availability, security, performance and scalability of AWS infrastructure.

What are the Benefits of AWS Lambda?

AWS Lambda has many benefits but we will discuss a few of them:

Serverless

AWS Lambda provides serverless deployment technology. You can use the AWS Lambda to create a serverless schedule.AWS Lambda function is a stateless service that handles requests by invoking AWS services.

Event Driven

AWS Lambda provides the Event-Driven Data Management for Microservices. Event-driven workflows for event-driven automation products. Event-driven automation also allows for easier management of computing resources at a scale.

No need to configure the server and automatically handles load balancing, auto-scaling, resource utilization memory management due to the Event-Driven service.

Sub Second Billing:

AWS Lambda only charges you for what you use. Charges of AWS Lambda based on the number of requests for your functions and the time your code executes.AWS Lambda provides a free tier for 1M free requests per month and 400,000 GB-seconds of compute time per month.

How AWS Lambda Works?

  • Authoring: Authoring Lambda Functions Using Eclipse IDE and AWS SDK Plugin.
  • Stateless: AWS Lambda works on stateless development.
  • Development: AWS Lambda allows developers to write code that triggers automatically to events.
  • Monitoring and Logging : AWS Lambda automatically monitors Lambda functions and reporting metrics through Amazon CloudWatch.it helps to monitor you code executes.AWS Lambda automatically tracks the number of requests, the latency per request, and the number of requests resulting in an error etc.

Which services are integrated with AWS Lambda?

  1. S3
  2. DynamoDB
  3. Kinesis
  4. CloudFormation
  5. SWF
  6. CloudTrail
  7. SES
  8. SWF
  9. Cognito
  10. API Gateway
  11. SNS
  12. CloudWatch

How long can an AWS Lambda function execute?

It takes a minimum of 1 second and a maximum of 300 seconds and it defaults timeout is 3 seconds, but you can set the timeout to any value between 1 and 300 seconds. The memory size you select for your Lambda functions determines how long functions can run in the free tier.

Here, I am ending the article, but this is not the end of the AWS Services Topic. I will share more services very soon. Well, that’s it. I hope at least someone will benefit from this article. Do share this article with your friends to let them know about AWS services.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

PHP Tutorial for beginners

Posted on 8 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 10 years ago

Bhumi