Functions - Concepts
Cold start is the time a function Instance takes to handle a request when it is called for the first time.
A CRON trigger is a mechanism used to automatically invoke a Serverless Function at a specific time on a recurring schedule. It works similarly to a traditional Linux cron job, using the
* * * * * format.
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.
An SQS (Simple Queue Service) trigger is a mechanism that connects a function to an SQS queue and invokes the function automatically whenever a message is added to the queue.
For each message that is sent to an SQS queue, the SQS trigger reads the message and invokes the associated function with the message as the input parameter. The function can then process the message and perform any required actions, such as updating a database or sending a notification.
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.
In a serverless architecture, a function is not running constantly, but is rather triggered by an event.
A trigger is a mechanism that connects the function to an event source and enables the function to execute automatically in response to specific events.
Triggers can take many forms, such as HTTP requests, messages from a queue or a stream, CRON schedules, etc.