Serverless Archietecture - rnakidi/dsa GitHub Wiki
Serverless Architecture Explained.
Before 2014, server management was a much more manual and complex task.
The concept of serverless computing was beginning to gain prominence, and AWS Lambda took it into the mainstream.
Now there are several options for how much infrastructure management abstraction we want.
Serverless computing abstracts server management tasks from the development teamโs workload.
This explanation describes serverless through the lens of FaaS.
Any technology that abstracts away the need to manage the underlying infrastructure and allows you to use it without direct control is a form of serverless.
One of the most prominent forms of serverless computing is Functions-as-a-Service (FaaS) to handle event-triggered code execution.
With this setup, cloud providers can allocate resources dynamically and only charge for the actual compute time used instead of reserved capacity.
Serverless architectures can support a wide range of applications, from simple CRUD operations to complex, event-driven data processing workflows.
It fosters a focus on code and functionality, streamlining the deployment of applications that can automatically adapt to fluctuating workloads.
Below are some key practices to keep in mind.
๐น Design for failure: Implement retry mechanisms and circuit breakers to handle failures and maintain reliability.
๐น Optimize for performance: Reduce cold start latency and maximize resource utilization through lightweight functions, appropriate programming languages, and aligned resource allocations.
๐น Security considerations: Ensure robust security by implementing the least privilege principle, securing API gateways, and encrypting data.
๐น Cost management: Monitor usage patterns and adjust resources to avoid increased expenses.
And below are some common pitfalls to navigate.
๐ธ Cold start latency: Mitigate cold starts with warm-up techniques and code optimization to ensure a positive user experience.
๐ธ Security in shared environments: Maintain strong security measures, including adequate function permissions & data encryption.
๐ธ Managing multiple services: Use Infrastructure as Code (IaC) & serverless frameworks to manage the complexity of integrating multiple services and functions.
Serverless can be ideal for event-driven applications, microservices, and fluctuating traffic apps, providing automatic scaling & rapid development.
Serverless has simplified infrastructure management, allowing devs to focus on code rather than infrastructure. At times it can be a great choice.