What is Serverless Computing?
- What is serverless computing?
- How does serverless architecture work?
- Why is serverless computing important?
- What are the use cases of serverless computing?
- What are the types of serverless architecture?
- What challenges can you face implementing serverless computing?
- What is a serverless-first strategy?
- Is serverless architecture secure?
- How can AWS support your serverless computing requirements?
What is serverless computing?
Serverless computing is an application development model where you build and deploy applications on third-party managed server infrastructure. All applications require servers to run. But in the serverless model, a cloud provider provisions, scales, and maintains the underlying components of your server infrastructure based on demand, rather than keeping a dedicated server asset available at all times.
Serverless computing is an abstraction of virtualized computing. The cloud provider manages the server resources your application runs on. For example, they perform operating system management, apply security patches, and perform file system and capacity management, load balancing, monitoring, and logging. As a result, your developers can focus on application design and still receive the benefits of cost-effective, efficient, and massively scalable server infrastructure.
How does serverless architecture work?
Serverless architecture emerged as a model that can often better serve the design of modern applications. Applications are divided into:
-
Frontend: The user interface, buttons, and layouts your customers interact with
-
Backend: The behind-the-scenes engine handling data storage, processing, and logic
Traditional server-based architecture runs the frontend on a content distribution network (CDN), and the backend continuously on hardware or software, waiting for user requests.
In serverless architecture, developers deploy the backend code onto cloud infrastructure managed by a cloud provider. A common serverless backend implementation is an event-driven architecture built into small, decoupled services that communicate by publishing, consuming, or routing events between each other when needed. The provider can scale up or down cloud resources for multiple services based on demand at any given time.
Serverless functions
Functions are small, discrete code units that perform a single task. A function requires computing resources, such as CPU and memory, to run. The cloud provider allocates these resources in their serverless platform only when required for the function to run.
Certain events can make the code unit run. For example, a user pressing a ‘Submit’ button in an application could be an event that triggers a serverless function. That function could be a database read query that returns relevant information to the user.
Scaling based on requests
The more requests a function receives, the more resources it needs to run. The serverless architecture monitors the load and allocates more and more cloud resources as needed. That function can process one or one million requests without needing any code changes, only held up by downstream events such as slow networks or databases.
Once a function stops receiving requests, the cloud provider scales down the underlying infrastructure to reduce your costs. Serverless allocates resources only when required: if there’s no usage, the environment can scale to zero.
Why is serverless computing important?
In the early days of the internet, anyone wanting to run a web application had to purchase and maintain physical servers. Companies typically store their physical servers in on-premises data centers or colocation facilities. This could be expensive because most applications only use a small fraction of server resources at any given time.
The cloud computing model initially solved this problem by allowing customers to create virtual machines, or instances, on a cloud provider’s infrastructure. However, customers still had to provision, configure, update, and scale their virtual servers.
In response to these issues, cloud providers began offering serverless technologies to increase agility and further optimize costs for user organizations. With serverless computing, your developers can deploy code, manage data, and integrate applications without worrying about deployment and infrastructure management tasks.
There are several benefits to adopting a serverless framework.
Increased developer productivity
Your development teams can focus on building applications instead of configuring them. Lower operational overheads mean your applications get to market faster. Your developers can respond to customer feedback more efficiently and frequently release application code changes.
Efficient scalability
Cloud vendors provide automatic scaling in serverless environments, so that your serverless applications scale automatically from zero to peak demand. In traditional environments, a server slows down under peak requests, requiring a new configuration, which can take additional time.
Lower costs
You only pay for the CPU, memory, and other computing resources required when your code runs. You pay nothing for idle resources. This pay-for-value billing model provides more effective resource utilization and avoids wastage from overprovisioning.
What are the use cases of serverless computing?
Many applications and systems can benefit from using a serverless computing architecture.
Stateless application development
Serverless architecture is ideal for asynchronous, stateless applications that do not save client data between sessions. Examples of serverless applications include chatbots, task schedulers, and IoT applications. For instance, Coca-Cola used AWS to increase its order fill rate. Coca-Cola used serverless services such as AWS Lambda.
Batch processing
Batch processing applications periodically complete high-volume, repetitive data jobs such as backups, filtering, and sorting. Batch processing is well-suited for serverless environments that scale massively when needed and incur no cost when unused.
For example, Vertex Pharmaceuticals used AWS to boost its image segmentation speed by 11 times. It used AWS Step Functions to quicken the time-consuming, meticulous processes that are involved in analyzing microscope images of biological samples from experiments.
Real-time data analytics
Serverless computing is ideal for real-time streaming engines to improve customer responsiveness. Serverless apps can handle vast volumes of streaming data from hundreds of thousands of sources with low latency and high bandwidth. As a result, you can derive insights in seconds instead of minutes.
For example, Genentech uses AWS serverless functionality for clinical data analysis. Researchers can now complete tasks in hours that previously would have taken weeks to run.
Business process automation
You can use the serverless approach for business process automation, where you digitize tedious and time-consuming tasks. Your developers can focus on translating business logic to application code without managing servers.
For example, Taco Bell migrated to AWS serverless for its ecommerce platform. In the shift, they saw reductions of 90% costs for infrastructure and a reduction of complexity in code also by 90%.
What are the types of serverless architecture?
In serverless architecture, the cloud provider manages backend tasks for your application. You can deploy custom code, and the cloud provider dynamically allocates resources whenever your code runs. The cloud solution also provides backend functionality that you can use directly without writing code from scratch.
Function as a service (FaaS)
Function as a service is a serverless architecture that developers can use to write custom backend functions and deploy the function code directly to the cloud infrastructure. When an application calls a function, the cloud provider either runs it on a set of existing server resources or spins up new ones if required. Such functions are called serverless functions because their provisioning, management, and execution process is abstracted away from developers.
Backend as a service (BaaS)
Backend as a service gives developers access to backend functions through an API. APIs are mechanisms that enable two software components to communicate with each other using a set of definitions and protocols.
In their serverless environments, cloud service providers provide API-based access to additional encryption, authentication, and cloud-accessible databases. They can also access other third-party backend services and applications. These serverless functions are prewritten and called directly in the code.
What challenges can you face implementing serverless computing?
While serverless architecture offers practical benefits for developers, users, and organizations, it can also introduce specific technical trade-offs. Preparing for these possible challenges can help you design a more robust serverless computing environment.
Cold starts
A cloud provider scales down a serverless function’s allocated resources to zero when it is not in use. When a new request comes in, the serverless provider must initialize the execution environment from scratch and allocate new resources. This process is called a cold start, and in some instances, it can create a delay, which can affect time-sensitive applications. To mitigate this potential issue, you can use features like Provisioned Concurrency in AWS Lambda to keep a number of core functions initialized and “warm.”
Observability and debugging
In a serverless, event-driven architecture, a single user action might trigger multiple decoupled functions and microservices across the network. That can make monitoring, logging, and identifying the root cause of errors more complex. Teams transitioning to serverless architecture should make sure they have access to distributed tracing and specialized observability tools to maintain their visibility into how data flows through the system.
What is a serverless-first strategy?
Serverless architecture has several core features:
-
Server infrastructure management is the provider’s responsibility
-
Pay-as-you-go services
-
Effectively instant scaling
-
Built-in fault tolerance
A serverless-first strategy prioritizes these tenets throughout an organization’s applications, operations, and development cycles. A serverless developer or serverless-first company works to build using these tenets primarily.
But serverless computing isn’t suitable for every workload. You should be able to incorporate non-serverless technologies as supporting architecture as needed.
Is serverless architecture secure?
Cloud vendors adopt a shared security model. The cloud provider is responsible for the security of the cloud, while customers are responsible for security in the cloud.
With serverless computing, the cloud provider manages many more infrastructure layers than for a traditional virtualized server instance, including operating systems and networking. Customers must follow the principles of least privilege and the best practices of securing a serverless application.
For example, in AWS FaaS solutions such as AWS Lambda, you can secure each resource with granular permissions using familiar tools like AWS Identity and Access Management. This can help improve the security posture of your serverless applications.
How can AWS support your serverless computing requirements?
Amazon Web Services (AWS) has many offerings to support your serverless computing.
Serverless Computing on AWS details technologies you can use to run code, manage data, and integrate applications without managing servers. With AWS serverless technology, you get automatic scaling, built-in high availability, and a pay-for-use billing model to increase agility and optimize costs. These technologies also eliminate infrastructure management and server management tasks like capacity provisioning and patching, so you can focus on writing code that serves your customers.
Serverless applications start with AWS Lambda, an event-driven compute service natively integrated with more than 200 AWS services. We also have a large number of additional supporting services, like these:
-
AWS Step Functions is a serverless, visual workflow orchestration service that enables developers to build, manage, and scale complex applications by coordinating AWS Lambda functions, containers, and other AWS services.
-
AWS Fargate to build serverless applications compatible with Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS)
-
Amazon Aurora Serverless to build serverless databases that automatically scale capacity based on your application needs
-
AWS AppSync to accelerate application development with scalable GraphQL APIs
Get started with serverless on AWS by creating a free account today.
Next Steps on AWS
Browse all cloud computing concepts
Browse all cloud computing concepts content here:
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages