NavigationContentFooter
Jump toSuggest an edit

Functions - Concepts

Reviewed on 14 November 2024

Cold Start

Cold Start is the time a function takes to handle a request when it is called for the first time.

Startup process steps are:

  • Downloading the container image (which contains the built Function) to our infrastructure
  • Starting the container and the runtime
  • Waiting for the container to be ready.

How to reduce cold starts

CRON trigger

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, and uses the UTC time zone. Refer to our cron schedules reference for more information.

Environment variables

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.

Function

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.

GB-s

Unit used to measure the resource consumption of a function. It reflects the amount of memory consumed over time.

JWT Token

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.

Handler

A handler is a routine/function/method that processes specific events. Upon invoking your function, the handler is executed and returns an output. Refer to our dedicated documentation for more information on the structure of a handler.

Namespace

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.

NATS trigger

A NATS trigger is a mechanism that connects a function to a NATS subject and invokes the function automatically whenever a message is published to the subject.

For each message that is sent to a NATS subject, the NATS 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.

Privacy policy

A function’s privacy policy defines whether a function may be executed anonymously (public) or only via an authentication mechanism provided by the Scaleway API (private).

Runtime

The runtime is the execution environment of your function. Regarding Serverless Function, it consists of the languages in which your code is written.

Sandbox

A sandbox is an isolation area for your function. Serverless Functions offer two sandboxing environments:

  • v2 - Recommended for faster cold starts.
  • v1 - Legacy sandboxing with slower cold start, but fully supports Linux system call interface.

Scale to zero

One of the advantages of Serverless Functions is that when your function is not triggered, it does not consume any resources, which allows for significant savings.

Scaling

Serverless Functions make scaling your application transparent, up to 50 instances of your function can be run at the same time.

Secrets

Secrets are an extra-secure type of environment variable. They are environment variables that are injected into your function and stored securely, but not displayed in the console after initial validation.

Serverless

Serverless allows you to deploy your Functions (FaaS) and Containerized Applications (CaaS) in a managed infrastructure. Scaleway ensures the deployment, availability, and scalability of all your projects.

Serverless Framework

Serverless.com (Serverless Framework) is a tool that enables the deployment of serverless applications without having to manage Serverless Function’s API call. Just write your configuration in a YAML and deploy, it handles everything.

Serverless Functions

Serverless Functions simplify deploying applications to the Cloud. They only require you to install a piece of business logic, a “function”, on any cloud platform, which executes it on demand. This allows you to focus on backend code without provisioning or maintaining servers.

The platform also handles function availability 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. 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.

Queue trigger

A queue trigger is a mechanism that connects a function to a queue created with Scaleway Queues, and invokes the function automatically whenever a message is added to the queue.

For each message that is sent to a queue, the 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.

Timeout

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.

Trigger

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.

vCPU-s

Unit used to measure the resource consumption of a container. It reflects the amount of vCPU used over time.

Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway