Skip to main content

Overview

CloudBase Cloud Functions is a serverless computing service provided by CloudBase, enabling you to run backend code without managing servers.

What is a Cloud Function

Cloud Functions runs on a Serverless architecture. You only need to write code in languages supported by the platform. CloudBase will fully manage the underlying computing resources, including:

  • Server Management: Automatically handles the management and maintenance of infrastructure
  • Resource Scheduling: Automatically allocates and reclaims computing resources based on request volume
  • Monitoring and Ops: Provides comprehensive logging, monitoring, and alarm capabilities

If you are using Cloud Function for the first time, it is recommended to read the Quick Start document to quickly experience the basic features of Cloud Function.

Tip

Cloud Development also provides Function-based Cloud Hosting service, with stronger performance and richer features. You can select a suitable service based on your actual needs.

Multi-language Support

CloudBase Cloud Functions supports multiple mainstream programming languages, allowing you to develop using the language you are familiar with:

LanguageVersion SupportFeaturesDocumentation Link
Node.js12.x, 14.x, 16.x, 18.xRich ecosystem, suitable for rapid developmentNode.js Documentation
Python3.6, 3.7, 3.9Strong data processing capabilities, AI/ML friendlyPython Documentation
Java8, 11Enterprise-grade applications, stable performanceJava Documentation
Golang1.xHigh performance, excellent concurrency handlingGolang Documentation
PHP7.2, 8.0Web development friendlyPHP Documentation

Cross-Language Invocation

Cloud Functions support cross-language invocation. You can:

  • On the Web, use the JavaScript SDK to invoke cloud functions written in Python
  • In Mini Program, invoke cloud functions written in Golang
  • In Flutter applications, invoke cloud functions written in Java

Advantages:

  • Language-agnostic: The caller does not need to know the implementation language of the function
  • Unified interface: Functions in all languages use the same invocation method
  • Flexible choice: You can choose the most suitable language based on business characteristics.

Function Types

CloudBase Cloud Functions provides two types to meet the needs of different scenarios:

Function TypeEvent FunctionWeb Cloud Function
Use CasesData processing, scheduled tasks, API interfacesWeb applications, SSE real-time communication, file upload and download
Invocation MethodsSDK invocation, HTTP requests, timer triggersDirectly handles HTTP requests
Framework SupportNo specific framework requirementsSupports Web frameworks such as Express.js, Koa.js, etc.
FeaturesSimple and easy to use, dedicated to business logic processingFull HTTP service capabilities

Event Function

Suitable for handling event-driven business logic, such as data processing, scheduled tasks, etc.

Key Features:

  • Focus on business logic without worrying about HTTP protocol details
  • Supports multiple trigger methods (SDK, HTTP, timers)
  • Simple input parameter and return value format

Web Cloud Function (Web Function)

Suitable for building complete Web applications and API services.

Key Features:

  • Complete HTTP request/response handling capabilities
  • Supports mainstream Web frameworks (Express.js, Koa.js)
  • Supports real-time communication such as SSE and WebSocket

Learn More:

Core Advantages

Multi-Platform Access

Full Platform Support, Available Anywhere

  • Multiple SDK Support: Web, Mini Program, Node.js, etc.
  • HTTP Interface: Supports access by any client via HTTP requests.
  • Seamless Integration: Internal calls with other CloudBase services require no key authentication.

NoOps

Focus on Business Without Worrying About Infrastructure

  • Serverless Management: Automatically handles server configuration, deployment, and monitoring
  • High Availability Guarantee: Built-in load balancing and failover mechanisms
  • Multi-Runtime: Supports Node.js, Python, Java, Go, PHP

Elastic Scaling

Scale on demand, Cost optimization

  • Fast Startup: Millisecond-level cold start, rapidly responding to user requests
  • HTTP Interface: Supports access by any client via HTTP requests.
  • Pay-as-you-go: Billing based on actual invocation count and execution time, with zero cost when idle

Development Ease

Comprehensive Tools, Efficient Development Process