This topic describes the basic operations in Function Compute. Function Compute allows you to quickly build an application by writing function code, meaning no server management is required. Additionally, Function Compute supports elastic scaling. You can use services on a Pay-As-You-Go basis.
To build a service in Function Compute, follow these steps:
Create a service.
Create a function. Program an application by using function code.
Trigger function execution. Use an event to trigger the execution of a function.
View function execution logs.
View service monitoring and alarming.
A service is an object that helps you organize and manage resources in Function Compute. You can grant access permissions, configure logs, or create functions for a service.
For more information about services, see Create a service.
For more information about service-related operations, see Basic operations.
Functions are segments of application code that run a specific function, and are used in system scheduling and running. You can use the handlers provided by Function Compute to write code and then deploy the code as functions in Function Compute. Services in Function Compute correspond to the microservices in the software application architecture. When you build an application in Function Compute, you must abstract service logic into microservices as needed, and then implement the microservices as services in Function Compute.
You can create multiple functions for one service and set different memory sizes, environment variables, or other attributes for each function. This layered abstraction of services and functions balances the tradeoff between system abstraction and implementation flexibility. For example, to implement a microservice, you can use Alibaba Cloud Intelligent Speech Interaction to convert text into voices, and then combine this voice segment with images to form a video. When text is converted into voices, other services are called. Usually, you can configure a small memory size for this operation. However, video synthesis is a computing-intensive service and requires a large memory. To reduce cost, you can combine functions of different specifications to implement a microservice.
For more information about functions, see Introduction.
For more information about function-related operations, see Basic operations.
In Function Compute, an event can be used to trigger the execution of a function. For example, if an OSS trigger is configured, a function is executed when an object in an OSS bucket is created or deleted. You can process the uploaded object or clean up the redundant data of the deleted object as needed. If a Log Service trigger is configured, a function is executed when a new log entry is written into the Logstore in Log Service. You can then easily process the new log entry.
For more information about triggers supported by Function Compute, see Triggers.
For more information about triggers, see Introduction.
For more information about trigger-related operations, see Basic operations.
You can directly use the console, the fcli tool, or the SDK to call a function with no need to configure triggers.
Viewing logs is critical to system debugging. For more information about how to configure and view logs in Function Compute, see Function logs.
You can view service monitoring in the Function Compute console.