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.
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:
| Language | Version Support | Features | Documentation Link |
|---|---|---|---|
| Node.js | 12.x, 14.x, 16.x, 18.x | Rich ecosystem, suitable for rapid development | Node.js Documentation |
| Python | 3.6, 3.7, 3.9 | Strong data processing capabilities, AI/ML friendly | Python Documentation |
| Java | 8, 11 | Enterprise-grade applications, stable performance | Java Documentation |
| Golang | 1.x | High performance, excellent concurrency handling | Golang Documentation |
| PHP | 7.2, 8.0 | Web development friendly | PHP 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 Type | Event Function | Web Cloud Function |
|---|---|---|
| Use Cases | Data processing, scheduled tasks, API interfaces | Web applications, SSE real-time communication, file upload and download |
| Invocation Methods | SDK invocation, HTTP requests, timer triggers | Directly handles HTTP requests |
| Framework Support | No specific framework requirements | Supports Web frameworks such as Express.js, Koa.js, etc. |
| Features | Simple and easy to use, dedicated to business logic processing | Full 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
- CLI Tool: Use CloudBase CLI to quickly deploy and manage
- Visual Management: Cloud Development Platform/Cloud Functions provides a complete visual operation interface
- Rich Resources: Provides multiple sample codes and project templates for quick start