Introduction – What Is Serverless?
People often ask about the serverless model introduced by AWS… Lambda! How can you run and manage applications & infrastructure with the absence of a server? Allowing us from having to install on-premise hardware and software to develop or run a new application, so we can put more emphasis on our business application rather then focusing on OS management and patching, provisioning, sizing, scaling, and availability etc.
Serverless platform should have the following capabilities:
No server management: no need to maintain or provision any servers. There is no software required to install and manage.
Flexible scaling: An environment that supports automatic scaling of your application by adjusting its capacity through the consumption i.e, throughput, memory.
High availability: A platform that supports built-in availability and fault tolerance features as the application itself is capable to be configured for high availability and fault tolerance by default.
No idle capacity: We don’t pay for idle/not running/offline capacity which is not being used as compute and storage purposes.
Benefits of Serverless Model
Abstraction of Compute Resources
Clearly stated in the name; serverless, you have no infrastructure to manage. Meaning, the underlying physical or virtual machine is abstracted away, i.e. infrastructure provisioning, configuration management and patching.Remove term: AWS Lambda Serverless AWS Lam
Before the introduction of the serverless architecture, many efforts were made available to provide these benefits by using Platform-as-a-Service (PaaS) offerings (a cloud service providing hardware and software tools allowing customers to develop, run, and manage applications without the complexity of building and maintaining the infrastructure typically associated with developing and launching an app), but this solution fell short and we were still responsible for managing aspects of the underlying servers and the configuration of the PaaS itself.
By using serverless methodology, you should only pay for the compute resources that are normally consumed, these platforms can be charged at a very granulated level, which means you don’t waste your money on the resources that are being used as idle or underutilized. By using serverless model, cost for the growth is linear that provides predictable and straightforward forecasting.
By using a serverless model, you’ll be able to scale quickly from hundreds to thousands of concurrent requests. This proactive scalability on your part becomes needless, and furthermore allows the serverless platform to scale to meet the traffic that is spiky, bouncy, and truly unpredictable.
Often, in on-premises environments, the main reason of compromising a platform could be an operator error. At the network layer of your environment, a misconfigured firewall or a misconfigured ACL can open the doors for malicious traffic into your environment, and an unpatched OS can be a piece of cake for attackers; zero-day or hidden vulnerabilities and weaknesses that can be exploited and oppressed by offenders or agents of industrial or national espionage.
AWS is responsible for providing the security of the basic Lambda execution environment and are able to offer substantial resources and expertise to this, your developers are free to concentrate on application level security and can also benefit from their managed security services. We can’t say that security is no longer a concern in serverless environments and clearly an application’s weakness and vulnerability or cross-site-scripting security hole will still be a problem – but the main benefit is that attack surface is reduced.
And recently, AWS created the Firecracker project (open-source) to provide more isolation and security, another ‘layer’ which is a lightweight hypervisor that provides an isolation around Lambda functions.
So what is AWS Lambda?
AWS Lambda is a core platform behind the serverless environment. It’s a compute service that allows to run code without managing provisioning servers. It runs your code only when it required and can scale automatically, from a few requests per second to a thousand requests AND you will pay only for the compute time consumed.
By using AWS Lambda platform, a code can be run virtually for any type of application or backend service without any administration. AWS Lambda executes a code on a high availability compute infrastructure and executes all administration tasks regarding compute, including server and OS maintenance, provisioning, scaling, code monitoring, and logging. You only need to provide code in one of AWS Lambda supported languages i-e Node.js, Java, C#, Go and Python.
AWS Lambda can be used to run your code in response to events; i.e changes to data in an Amazon S3 bucket or an Amazon DynamoDB table, HTTP requests using Amazon API Gateway, API calls using AWS SDKs. By using these capabilities, AWS Lambda can be used to easily build data processing triggers for AWS services like Amazon S3 and Amazon DynamoDB processes that stream data stored in Kinesis, or you can create your own back-end that operates at AWS’s scale, performance, and security.
Advantages of Using AWS Lambda
Bring your own code
- Node.js, Java, Python, C#, Go
- Bring your own libraries (even native ones)
Simple resource model
- Select power rating from 128 MB to 3 GB
- CPU and network allocated proportionately
- Synchronous or asynchronous
- Integrated with other AWS services
- Securely grant access to resources and VPCs
- Fine-grained control for invoking your functions
AWS Lambda Pricing
With AWS Lambda, you will pay only for what you are using. You will be charged per request for your functions and the time duration which takes to execute your code. You can follow Lambda Pricing [email protected] Pricing for further pricing details.
Supported Frameworks with AWS Lambda
The Serverless Framework7 (originally JAWS) is the first to be released and is a mature framework. Serverless Framework is written in node.js and uses AWS CloudFormation for provisioning of AWS resources which means serverless framework deploys the Lambda functions themselves, along with any other CloudFormation provisionable resources that can be used to support their execution. Serverless Framework can also be used to deploy non-web-applications to Lambda.
Zappa9 is another framework for serverless applications written in Python language. It can work with any WSGI application, therefore, it can be used with common Python web application frameworks i.e Flask, Django, and Bottle.
Chalice is produced by AWS Labs. Chalice8 is a micro-framework that used to deploy Python applications to Lambda and route requests using API Gateway. Chalice offers Python decorators that can be used to route requests, but don’t propose management of any other AWS services outside of API Gateway.
Sparta is written in Go. Sparta10 is like as Serverless Framework uses CloudFormation to provision and manage AWS resources at back-end.
SAM stands for Serverless Application Model12 is a set of extensions to CloudFormation which designed to enable the serverless applications deployment with API Gateway, Lambda, DynamoDB.
Apex11 is the node.js framework that allows to build, provisioning and management of Lambda functions. Apex can also integrate with other tools such as Hashicorp Terraform.
I hope you’ve enjoyed reading this post, if you feel it has some shareable information, you can share on below, please let us know!