Skip to main content

CloudBase Cloud Function Overview

CloudBase cloud function is a serverless computing service provided by Tencent Cloud TCB, enabling you to focus on business logic development without managing servers. Write code, upload, run — it's that simple.

Basic Features

CloudBase cloud function is a code snippet running in the cloud that automatically executes when an event occurs. You only need to write business logic, and CloudBase is responsible for server management, scale-out and scale-in, and Ops.

Core Capabilities:

  • 🚀 Event-Driven Execution - Automatically triggered by HTTP requests, data changes, or scheduled tasks
  • Automatically Scale - Automatically adjusts based on request volume, with a maximum concurrency of 1000
  • 💰 Pay-as-you-go - Pay only for what you use, no cost when idle
  • 🔗 Service Integration - Seamlessly integrated with databases, storage, and authentication

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

Function type:

  • Regular Cloud Function - Handles structured business logic, suitable for API interfaces and data processing
  • HTTP Cloud Function - Full-fledged Web service capabilities, suitable for Web applications and file upload

Working Principle

Execution Flow

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

  1. Event Triggering - HTTP requests, database changes, scheduled tasks, and other events trigger functions
  2. Instance Management - CloudBase automatically creates function instances and loads the code
  3. Code Execution - Executing business logic in an isolated environment
  4. Service Invocation - Accessing cloud services such as databases and storage via SDK
  5. Result Return - Returns the result after processing, and instances are automatically recycled

Trigger Methods

Trigger MethodsDescriptionUse Cases
SDK InvocationDirect client SDK invocationMini Programs, Web applications
HTTP RequestInvoked via HTTP APIThird-party system integration
Timer TriggerAutomatically executes based on time schedulesData statistics, system maintenance

Runtime Environment Features

  • Isolation - Each function runs in an independent container environment
  • Stateless - Function instances do not share state
  • Ephemeral - Instances are automatically recycled after execution
  • Elasticity - Automatically creates and destroys instances based on workload

Development Workflow

Quick Start

  1. Quick Start - Create your first function in 5 minutes
  2. Development Guide - Detailed development documentation
  3. Sample Code - Rich sample repository
  4. Web Console - visual management page

Example