tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

Related Concepts

PDF
Focus Mode
Font Size
Last updated: 2024-12-02 20:27:11

Tencent Cloud Serverless Cloud Function (SCF) is a function-as-a-service (FaaS) product that provides a serverless FaaS computing platform. Therefore, when combined with the trigger event source, an SCF functions can be triggered by an event generated by the trigger source.

Serverless

The origin of the serverless architecture concept can be explained in the article Serverless Architecture by Mike Roberts at Martin Fowler's blog website.
Serverless does not mean that computation can be performed without a server; instead, it means that developers can use relevant resources without caring about the underlying servers.
More broadly, cloud services that can be used directly without configuring or understanding the underlying servers can also be seen as serverless to some extent.
In the SCF product, we are targeting the computation in serverless scenarios. SCF provides FaaS capabilities in serverless mode.

FaaS

Function-as-a-service (FaaS) provides the capability to execute stateless, transient, event-triggered code directly in the cloud.
FaaS is different from traditional application architectures. It provides an event-triggered operation method, where a function is not always running but triggered by an event when the event occurs, and the event is only handled once during one execution. Therefore, in the code of the function, only the handling flow for one event needs to be considered, and high-concurrency handling of many events is supported by the multi-instance function concurrency implemented by the platform.
In order to support high concurrency, the SCF platform features automatic elastic scalability, which will launch more instances to handle event requests when high volumes of requests are received and will reduce function instances (down to zero) when less or no requests are received. Therefore, in order to match the automatic scaling capability, the function code needs to be developed in a stateless manner, that is, the relevant state data is not retained in the running memory of the function or depended on when the function is executed multiple times. The state data of the function can be stored in external persistent storage services such as Cloud Memcached, TencentDB, and COS.

Triggers and trigger sources

Anything that can generate an event and trigger the execution of a function can be referred to as a trigger or trigger source. The trigger triggers function execution by passing the event to the function after it generates the event itself.
The trigger can trigger the function synchronously or asynchronously according to its own characteristics. When the function is triggered synchronously, the trigger will wait for the function to complete and return the execution result; when the function is triggered asynchronously, the trigger will only trigger the function and ignore the execution result.
When connecting with other Tencent Cloud products or services, SCF has some special ways of implementing such as push mode and pull mode.
Push mode: a trigger actively pushes the event to the SCF platform and triggers function execution.
Pull mode: the SCF platform pulls an event through the pull module from a trigger and triggers function execution.

Trigger events

A trigger passes an event to a function when the function is triggered. The event is represented by a specific data structure in JSON format and passed to the function as the event input parameters of the function.
The JSON data content of the trigger event will be converted to corresponding data structures or objects in different language environments, and you do not need to perform the conversion from JSON structures to data structures in the code on your own.For example, in Python environment, the JSON data content will be converted to a complex dict object, that is, the event input parameters of the function is a complex Python dict object. In Go or Java, the input parameters have to be an object that can match the event data structure. For more information on specific implementations, please see Development Language Descriptions.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback