Skip to main content

Cloud Functions

CloudBase Cloud Functions is a serverless computing service provided by Tencent CloudBase, letting you focus on business logic development without managing servers. Write code, upload, run — that's it.

Basic Features

CloudBase Cloud Functions are code snippets running in the cloud that execute automatically when events occur. You only write business logic; CloudBase handles server management, scaling, and operations.

Core capabilities:

  • 🚀 Event-driven execution - Automatically triggered by HTTP requests, data changes, and scheduled tasks
  • Automatic scaling - Adjusts automatically based on request volume, up to 1000 concurrent executions
  • 💰 Pay-as-you-go - Pay only for what you use, zero cost when idle
  • 🔗 Service integration - Seamless integration with database, storage, and authentication

Supported languages: Node.js, Python, Java, Go, PHP

Function types:

  • Regular Cloud Functions - Handle structured business logic, suitable for API endpoints and data processing
  • HTTP Cloud Functions - Full web service capabilities, suitable for web applications and file uploads

How It Works

Execution Flow

User request → Event trigger → Function instance starts → Code execution → Result returned → Instance recycled

  1. Event trigger - HTTP requests, database changes, scheduled tasks, etc. trigger the function
  2. Instance management - CloudBase automatically creates a function instance and loads the code
  3. Code execution - Business logic runs in an isolated environment
  4. Service calls - Access cloud services such as database and storage via SDK
  5. Result returned - After processing completes, the result is returned and the instance is recycled

Trigger Methods

Trigger MethodDescriptionUse Cases
SDK callDirect call from client SDKMini Program, Web applications
HTTP requestCall via HTTP APIThird-party system integration
Scheduled triggerExecutes automatically on a time ruleData statistics, system maintenance

Runtime Environment Characteristics

  • Isolation - Each function runs in an independent container environment
  • Stateless - Function instances do not share state
  • Ephemeral - Instances are automatically recycled after execution completes
  • Elastic - Instances are automatically created and destroyed based on load

Quick Start

  1. Quick Start - Create your first function in 5 minutes
  2. Development Guide - Detailed development documentation
  3. Example Code - A rich example library
  4. Web Console - Visual management interface

Examples