Serverless
What is serverless ?
Serverless refers to a cloud computing model whereby application developers don't have to provision servers or manage scaling for their app. Instead, those routine tasks are abstracted away by the cloud provider.
In a standard IaaS model, users prepurchase units of capacity, meaning you pay for “always-on” server components to run your applications. This is not the case in a serverless model. Instead, an event will trigger application code to run, then the cloud provider dynamically allocates resources for that code, and the user stops paying when the code finishes executing. In addition to the obvious cost and efficiency benefits, serverless also frees developers from routine and menial tasks associated with application scaling and server provisioning.
How does serverless computing work?
Backend-as-a-Service (BaaS)
By utlizing a variety of third-party services and applications to comprise your application. For instance, a cloud-provider may offer authentication services, extra encryption, cloud-accessible databases, and high-fidelity usage data. These back end services are typically accessed with a call to an application programming interface (API) set up by the cloud provider, allowing simpler integration into your systems than developing these features in-house.
Function-as-a-Service (FaaS)
Developer still needs to write server-side logic, but the application is deployed into containers that are managed by a cloud provider, which is the primary benefit of serverless.
What are the pros and cons of serverless?
Pros
serverless can increase developer productivity
It enables developers to focus on code, not infrastructure.
Pricing is done on a per-request basis, allowing users to pay only for what they use.
For certain workloads, such as ones that require parallel processing, serverless can be both faster and more cost-effective than other forms of compute
Serverless application development platforms provide almost total visibility into system and user times and can aggregate the information systematically.
Cons:
Long-running processes: FaaS and serverless workloads are designed to scale up and down perfectly in response to workload, offering significant cost savings for spiky workloads. But for workloads characterized by long-running processes, these same cost advantages are no longer present and managing a traditional server environment might be simpler and more cost-effective.
Vendor lock-in: Serverless architectures are designed to take advantage of an ecosystem of managed cloud services and, in terms of architectural models, go the furthest to decouple a workload from something more portable, like a VM or a container. For some companies, deeply integrating with the native managed services of cloud providers is where much of the value of cloud can be found; for other organizations, these patterns represent material lock-in risks that need to be mitigated.
Cold starts: Because serverless architectures forgo long-running processes in favor of scaling up and down to zero, they also sometimes need to start up from zero to serve a new request. For certain applications, this delay isn’t much of an impact, but for something like a low-latency financial application, this delay wouldn’t be acceptable.
Monitoring and debugging: These operational tasks are challenging in any distributed system, and the move to both microservices and serverless architectures (and the combination of the two) has only exacerbated the complexity associated with managing these environments carefully.
References
Last updated