Serverless Framework Deploy Using AWS Lambda Function

Tarun Manrai
Dev Genius
Published in
4 min readJun 26, 2020

--

aws lambda

AWS Lambda is one of the most popular serverless computing services out there. It is also the most popular provider used with the Serverless Framework. AWS Lambda is a serverless computing service provided by Amazon Web Services (AWS). Users of AWS Lambda create functions, self-contained applications written in one of the supported languages and runtimes, and upload them to AWS Lambda, which executes those functions in an efficient and flexible manner. The Lambda functions can perform any kind of computing task, from serving web pages and processing streams of data to calling APIs and integrating with other AWS services.

Full Article: http://entradasoft.com/blogs/serverless-framework-deploy-using-aws-lambda-function

Why use serverless?

Serverless enables you to build modern applications with increased agility and lower total cost of ownership. Building serverless applications means that your developers can focus on their core product instead of worrying about managing and operating servers or runtimes, either in the cloud or on-premises. This reduced overhead lets developers reclaim time and energy that can be spent on developing great products which scale and that are reliable.

What are the benefits of serverless?

No server management: There is no need to provision or maintain any servers. There is no software or runtime to install, maintain, or administer.

Flexible scaling: Your application can be scaled automatically or by adjusting its capacity through toggling the units of consumption

Pay for value: Pay for consistent throughput or execution duration rather than by server unit.

Automated high availability: Serverless provides built-in availability and fault tolerance. You don’t need to architect for these capabilities since the services running the application provide them by default.

Why is AWS Lambda an essential part of the Serverless architecture?

When building Serverless applications, AWS Lambda is one of the main candidates for running the application code. Typically, to complete a Serverless stack you’ll need:

  • a computing service
  • a database service
  • an HTTP gateway service.

Lambda fills the primary role of the compute service on AWS. Lambda supports many of the most popular languages and runtimes, so it’s a good fit for a wide range of Serverless developers.

How it works?

how AWS lambda works

Benefits of using AWS Lambda

Pay as you go: In AWS Lambda, you pay only for the compute your functions use, plus any network traffic generated. This type of billing is generally more cost-effective.

Managed Infrastructure: You do not need to worry about underlying servers on which your code executes, all is managed by AWS for you.

Automatic Scaling: AWS Lambda creates the instances of your function as they are requested. and at the same time your functions are available whenever the load increases or decreases. You only pay for each functions run time.

Integration with other AWS products: AWS Lambda integrates with services like DynamoDB, S3 and API Gateway, allowing you to build functionally complete applications within your Lambda functions.

Most common use cases for AWS Lambda?

Some of the most common use cases for AWS Lambda are as follows

Scalable APIs: AWS Lambda automatically scales individual functions according to the demand for them, so different parts of your API can scale differently according to current usage levels.

Data processing: Lambda functions are optimized for event-based data processing. For example, you could employ Lambda to do some work every time an item in DynamoDB is created or updated

Real-time stream processing: You can use AWS Lambda and Amazon Kinesis to process real-time streaming data for application activity tracking, transaction order processing, click stream analysis, data cleansing, metrics generation, log filtering, indexing, social media analysis, and IoT device data telemetry and metering.

v You can use AWS Lambda to preprocess data before feeding it to your machine learning model. With Lambda access to EFS, you can also serve your model for prediction at scale without having to provision or manage any infrastructure.

Backends: You can build serverless backends using AWS Lambda to handle web, mobile, Internet of Things (IoT), and 3rd party API requests. Take advantage of Lambda’s consistent performance controls, such as multiple memory configurations and Provisioned Concurrency, for building latency-sensitive applications at any scale.

Limitations of AWS Lambda

While AWS Lambda has many advantages, there are a few things you should know before using it in production.

Cold start time: When a function is started in response to an event, there may be a small amount of latency between the event and when the function runs.

Execution time/run time: A Lambda function will time out after running for 15 minutes. There is no way to change this limit. If running your function typically takes more than 15 minutes, AWS Lambda might not be a good solution for your task.

Memory available to the function: The options for the amount of RAM available to the Lambda functions range from 128MB to 3,008MB with a 64MB step.

Code package size: The zipped Lambda code package should not exceed 50MB in size, and the unzipped version shouldn’t be larger than 250MB.

Payload size: When using Amazon API Gateway to trigger Lambda functions in response to HTTP requests (i.e. when building a web application), the maximum payload size that API Gateway can handle is 10MB.

Limited number of supported runtime: While AWS Lambda allows adding custom runtimes, creating them can be a lot of work. So if the version of the programming language you are using isn’t supported on Lambda, you might be better off using AWS EC2 or a different cloud provider.

Read more: http://entradasoft.com/blogs

--

--