Jump toUpdate content
Functions - Concepts
Cold start is the time a function Instance takes to handle a request when it is called for the first time.
An environment variable is a variable whose value is set outside the program, typically through functionality built into the operating system or microservice. An environment variable is made up of a name/value pair, and any number may be created and available for reference at a point in time.
A function defines a procedure on how to change one element into another. The function remains static, while the variables that pass through it can vary.
Unit used to measure the resource consumption of a function. It reflects the amount of memory consumed over time.
A JWT (JSON Web Token) is an access token you can create from the console or the API to enable an application to access your Private function.
A handler is a routine/function/method which is specialized in a certain type of data or focused on certain special tasks.
A namespace is a project that allows you to group your functions. Functions in the same Namespace can share environment variables and access tokens, defined at the namespace level.
The runtime is the execution environment of your function. Regarding Serverless Function, it consists in the languages in which your code is written.
Scale to zero
One of the advantages of Serverless Function is that when your function is not triggered, it does not consume any resources which allows great savings.
Serverless Functions make scaling your application transparent, up to 20 instances of your function can be run at the same time.
Secrets are an extra-secure type of environment variable. They are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation.
Serverless allows you to deploy your Functions (FaaS) and Containerized Applications (CaaS) in a managed infrastructure. Scaleway ensures the deployment, the availability and the scalability of all your projects.
Serverless.com (Serverless Framework) is a tool that enable to deploy serverless applications without having to manages Serverless Function’s API call. Just write your configuration in a yaml and deploy, it handles everything.
Serverless Functions simplify deploying applications to the Cloud. You are only required to install a piece of business logic, a “function” on any cloud platform. The platform executes the function on demand. Therefore you can focus on backend code without provisioning or maintaining servers. In addition, the platform makes the function available and manages resource allocation for you. For instance, if the system needs to accommodate 100 simultaneous requests, it allocates 100 (or more) copies of your service. Also, if demand drops to two concurrent requests, it destroys the unneeded ones. You pay for the resources your functions use, and only when your functions need them.
The timeout is the maximum length of time your handler can spend processing a request before being stopped. This value must be in the range 10s to 900s.
Triggers are a named channel for a class of events. The following are examples of triggers:
- A trigger of location update events.
- A trigger of document uploads to a website.
- A trigger of incoming emails.