Learn about serverless computing and how we use it.
Serverless computing is type of a cloud computing where the provider allocates and manages the web server execution environment. In this setting, a developer is only concerned with providing the code, given as functions, that run on the server while everything else—planning the server capacity, configuring, managing and maintaining the server, providing fault tolerance, scaling up or down—is handled by the cloud provider.
In this sense, the name serverless is a bit misleading since servers are still being used. However, developers do not need to manage them, and can instead concentrate on implementing the application logic.
In a typical use case, a developer implements a function, for instance one that takes an image and resizes it, and uploads the code to the serverless runtime environment; the environment is often called Function-as-a-Service platform, or FaaS.
Within FaaS, the developer we can implement a component of an application, like an image resizer module, or use multiple functions to implement an entire application.
For every function, the developer needs to define the trigger that specifies how the function is invoked. This can be when, for instance, an explicit HTTP request is received, or an event is triggered or by some other invocation. Usually the provided function only executes the application logic and does not store any data. If storage is required, additional cloud services need to be used.
Within a FaaS platform, vendors provide support for several programming languages and APIs. While development stacks vary between vendors, common choices include Java, Python, Go, JavaScript and others. Almost as a rule, the executed function runs within an isolated environment, like a container.
Serverless has certain benefits compared to traditional development and deployment approaches. Serverless computing has these benefits:
However, serverless also has its limitations:
Serverless is a good fit for these use-cases:
In general, any application that occasionally or periodically requires a bit more computing resources, but otherwise has considerable idle periods, is a good use-case, since serverless allows for speedy development, easy deployment and is billed only when in use.
However, applications that have idle times, but when invoked require quick response, are usually not the best fit. The reason is that once the function is idling, the FaaS platform may decide to shut it down to save resources. When such shut-down function is invoked, it takes longer to respond due to the cold start issue.
Serverless is a cloud computing paradigm that allows developers to directly deploy code on vendor-managed server execution environments or function-as-a-service platforms.
Compared to other types of cloud computing, serverless allows renting the most fine-grained computing resources. At first cloud vendors offered bare-metal machines, then virtual machines, then containers. With serverless, developers can directly rent webserver runtimes to execute their code.
Hypertext Transfer Protocol. A protocol that connects web browsers to web servers when they request content.