AWS Lambda and Serverless Computing

AWS Lambda and Serverless Computing

Cloud Computing

Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centers and servers, you can access technology services, such as computing power, storage, and databases, on an as-needed basis from a cloud provider like Amazon Web Services (AWS).

Cloud Computing Benefits:

1. High Speed – Quick Deployment

2. Automatic Software Updates and Integration

3. Efficiency and Cost Reduction

4. Data Security

5. Scalability

6. Collaboration

7. Unlimited Storage Capacity

8. Back-up and Restore Data

9. Disaster Recovery

10. Mobility

11. Data Loss Prevention

12. Control

13. Competitive Edge

What is Amazon Web Services ?

Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally. Millions of customers including the fastest-growing startups, largest enterprises, and leading government agencies are using AWS to lower costs, become more agile, and innovate faster.

?AWS EC2:

Among the vast array of services that Amazon offers, EC2 is the core compute component of the technology stack. In practice, EC2 makes life easier for developers by providing secure, and resizable compute capacity in the cloud. It greatly eases the process of scaling up or down, can be integrated into several other services, and comes with a plan where you only pay for how much you use it.

Amazon API Gateway:

Amazon API Gateway is an Amazon Web Services (AWS) feature that enables developers to connect non-AWS applications to AWS back-end resources, such as servers and code. The gateway increases AWS customers' access to compatible applications and the overall utility of Amazon's other cloud services.

AWS S3:

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. You can use Amazon S3 to store and retrieve any amount of data at any time, from anywhere.

Amazon Virtual Private Cloud (VPC):

Amazon Virtual Private Cloud is a commercial cloud computing service that provides users a virtual private cloud, by "provisioning a logically isolated section of Amazon Web Services Cloud". Enterprise customers are able to access the Amazon Elastic Compute Cloud over an IPsec based virtual private network.

AWS DynamoDB:

DynamoDB is a fully managed NoSQL database that supports both document and key-value store models. Its flexible data model, reliable performance, and automatic scaling of throughput capacity make it a great fit for mobile, web, gaming, ad tech, IOT, and many other applications.

AWS CloudWatch:

Amazon CloudWatch is a monitoring and observability service built for DevOps engineers, developers, and site reliability engineers (SREs), IT managers, and product owners. CloudWatch provides you with data and actionable insights to monitor your applications, respond to system-wide performance changes, and optimize resource utilization. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events. You get a unified view of operational health and gain complete visibility of your AWS resources, applications, and services running on AWS and on-premises. You can use CloudWatch to detect anomalous behavior in your environments, set alarms, visualize logs and metrics side by side, take automated actions, troubleshoot issues, and discover insights to keep your applications running smoothly.

AWS Serverless Computing:

The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings. With just a few lines per resource, you can define the application you want and model it using YAML. During deployment, SAM transforms and expands the SAM syntax into AWS Cloud Formation syntax, enabling you to build serverless applications faster.

What is a serverless architecture?

A serverless architecture is a way to build and run applications and services without having to manage infrastructure. Your application still runs on servers, but all the server management is done by AWS. You no longer have to provision, scale, and maintain servers to run your applications, databases, and storage systems.

No alt text provided for this image


AWS Lambda:

AWS Lambda is an event-driven, serverless computing platform provided by Amazon as a part of Amazon Web Services. Therefore you don’t need to worry about which AWS resources to launch, or how will you manage them. Instead, you need to put the code on Lambda, and it runs.

In AWS Lambda the code is executed based on the response of events in AWS services such as add/delete files in S3 bucket, HTTP request from Amazon API gateway, etc. However, Amazon Lambda can only be used to execute background tasks.

How AWS Lambda Works?

Developers can start using AWS Lambda services, either by uploading the code or coding directly in the Lambda’s code editor and mention the conditions triggers the code. The code executed on the lambda run time environment is called a lambda function. With this any event can prompt your function, without developers worrying about handling the server or?getting the right type of application or resource. Meaning that businesses don’t have to pay when your code is not running, thereby saving on server costs.

?Once an event triggers, Lambda runs associated code by picking resources to execute an event, by making use of?the best resources available in the infrastructure ecosystem. Thereby enabling businesses to have intelligent management of IT infrastructure. The AWS Lambda run-time environment's control plane entity consists of APIs that facilitate AWS resources for the application execution. Another key aspect of run time environment is data pane, this provides APIs to run the functions. Whenever a function is called to run a function, data pane facilitates either a dedicated execution environment or uses the allotted one. This execution environment is never shared with other functions.

No alt text provided for this image

Advantages of AWS Lambda:

Users can run the applications either from the web or in a mobile platform.

Lambda makes use of AWS Identity and Access Management (IAM) module to ensure that only the right users or groups get access to the application or function.

Lambda speeds up the execution process and scales your application or code, by executing the events triggering a particular code.

Developers don't have to focus on infrastructure to run an application, allowing them to focus on business logic.

Strong APIs enable user applications to easily integrate with innovative AWS services like AI and machine learning to develop intelligent business applications or add intelligence into your applications.

Process For Creating AWS Lambda Function:

Step 1: Login into your AWS account and click on “Sign in to the Console.”??????

No alt text provided for this image

?Step 2: Enter your login ID and password.

Step 3: Select Lambda under "AWS Services"??????

No alt text provided for this image

Step 4: Click on “Create Function”:

No alt text provided for this image

Step 5:?Select options and click on “Create Function” button

Function Type: Author from scratch

Name : lambda Blog

Runtime: Node.js 10.x

Role: Choose an existing role / create any custom rule

Existing Role: lambda_basic_execution

No alt text provided for this image

Step 6:?Now you will be able to see the below screen. Choose a way to upload/create code in the lambda function.??

No alt text provided for this image

Step 7:?Now you can write your code in the editor provided, it runs on Nodejs which we selected earlier.

No alt text provided for this image

Step 8:??Handler name should be the same as your function name, this way AWS knows which function to execute.

No alt text provided for this image

Step 9:?We can add more options like execution timeout, environment variables, tags to group out our other functions, memory etc.

No alt text provided for this image

Step 10:?Click "Save."?

No alt text provided for this image

Step 11:?Now copy ARN number?on the top right corner.?

No alt text provided for this image

Applications of AWS

1. Storage and Backup

2. Websites

3. Gaming

4. Mobile, Web and Social Applications

要查看或添加评论,请登录

社区洞察

其他会员也浏览了