Oracle Cloud Infrastructure Documentation

Oracle Functions Concepts

This topic describes key concepts you need to understand when using Oracle Functions.

Functions Developers

Oracle Cloud Infrastructure users who use Oracle Functions to create and deploy functions are referred to as 'functions developers'. To use Oracle Functions, functions developers must have Oracle Cloud Infrastructure user accounts. Their user accounts must belong to groups to which appropriate policies grant access to function-related resources.

See Create Groups and Users to use with Oracle Functions, if they don't exist already.

Applications

In Oracle Functions, an application is:

  • a logical grouping of functions
  • a common context to store configuration variables that are available to all functions in the application

When you define an application in Oracle Functions, you specify the subnets in which to run the functions in the application.

Oracle Functions shows applications and their functions in the Console.

See Creating Applications.

Functions

In Oracle Functions, functions are:

  • small but powerful blocks of code that generally do one simple thing
  • grouped into applications
  • stored as Docker images in a specified Docker registry
  • invoked in response to a CLI command or signed HTTP request

When you deploy a function to Oracle Functions using the Fn Project CLI, the function is built as a Docker image and pushed to a specified Docker registry.

A definition of the function is stored as metadata in the Oracle Functions server. The definition describes how the function is to be executed and includes:

  • the Docker image to pull when the function is invoked
  • the maximum length of time the function is allowed to execute for
  • the maximum amount of memory the function is allowed to consume

Oracle Functions shows functions, and the applications into which they are grouped, in the Console.

See Creating, Deploying, and Invoking a Helloworld Function.

Invocations

In Oracle Functions, a function's code is run (or executed) when the function is called (or invoked). You can invoke a function that you've deployed to Oracle Functions from:

  • The Fn Project CLI.
  • The Oracle Cloud Infrastructure SDKs.
  • Signed HTTP requests to the function's invoke endpoint. Every function has an invoke endpoint.
  • Other Oracle Cloud services (for example, triggered by an event in the Events service) or from external services.

When a function is invoked for the first time, Oracle Functions pulls the function's Docker image from the specified Docker registry, runs it as a Docker container, and executes the function. If there are subsequent requests to the same function, Oracle Functions directs those requests to the same container. After a period being idle, the Docker container is removed.

Oracle Functions shows information about function invocations in metric charts.

See Invoking Functions.

Triggers

A trigger is the result of an action elsewhere in the system, that sends a request to invoke a function in Oracle Functions. For example, an event in the Events service might cause a trigger to send a request to Oracle Functions to invoke a function. Alternatively, a trigger might send regular requests to invoke a function on a defined, time-based schedule.

A function might not be associated with any triggers, or it can be associated with one or multiple triggers.