You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Serverless Cloud Function (SCF) is Tencent Cloud's event-driven serverless compute service. SCF lets you run code without managing servers — the equivalent of AWS Lambda or Alibaba Cloud Function Compute.
SCF allows you to:
graph TD
E["Event (e.g., COS upload, API Gateway request)"] --> SCF["SCF Runtime"]
SCF --> Code["Your Code"]
Code --> Resp["Response / Output"]
| Runtime | Versions |
|---|---|
| Python | 2.7, 3.6, 3.7, 3.9 |
| Node.js | 10, 12, 14, 16, 18 |
| Java | 8, 11 |
| Go | 1.x |
| PHP | 5.6, 7.2, 7.4, 8.0 |
| Custom Runtime | Any language |
| Custom Image | Docker container images |
Triggers define how a function is invoked:
| Trigger | Use Case |
|---|---|
| API Gateway | HTTP requests (REST APIs, webhooks) |
| COS | File uploads, deletions in Cloud Object Storage |
| Timer | Scheduled execution (cron expressions) |
| CMQ (Message Queue) | Process messages from Cloud Message Queue |
| CKafka | Process messages from Cloud Kafka |
| CLS (Log Service) | Process log data in real time |
| MPS (Media Processing) | Media transcoding completion events |
graph LR
A["User uploads image"] --> B["COS bucket"]
B --> C["COS event"]
C --> D["SCF function"]
D --> E["Creates thumbnail"]
E --> F["Saves to COS"]
| Setting | Description | Limits |
|---|---|---|
| Memory | Allocated memory (64 MB to 3,072 MB) | CPU scales with memory |
| Timeout | Maximum execution time | Up to 900 seconds (15 minutes) |
| Environment variables | Configuration key-value pairs | Up to 4 KB |
| Layers | Shared dependencies | Up to 5 layers |
| Concurrency | Reserved and provisioned concurrency | Configurable per function |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.