Function Compute runs code in response to events or HTTP requests, without requiring you to provision or manage servers. The following scenarios show where it fits well and how it integrates with other Alibaba Cloud services.
Scenario overview
| If you want to... | Use Function Compute to... |
|---|---|
| Build scalable web applications | Handle traffic spikes without managing infrastructure or pre-provisioning capacity |
| Process data from object storage, message queues, or databases | Run transformation logic automatically when events arrive |
| Serve a trained AI model | Execute inference code only when requests arrive, with elastic compute on demand |
| Transcode video files at scale | Process multiple files in parallel with millisecond-level scaling |
Web applications
Web applications often need to scale unpredictably, remain available across regions, and ship new features without infrastructure delays. With Function Compute, engineers write business logic — not cluster management code. Applications run across multiple data centers for high availability, and instances scale within milliseconds to absorb traffic peaks with no manual intervention required.
Key characteristics:
Zero infrastructure overhead: Function Compute handles cluster O&M, so engineering teams focus on application logic.
Millisecond scaling: Instances are automatically scheduled to handle traffic peaks without pre-provisioning.
Flexible billing: Pay only for what you use, across a range of billing options suited to different traffic patterns.
Broad runtime support: Multiple programming languages and custom runtimes are supported, and traditional application frameworks are compatible, making migration straightforward.
Data extract, transform, and load (ETL) processing
ETL pipelines typically require integrating multiple data sources — object storage, message queues, databases — and running transformation logic whenever new data arrives. Function Compute supports a wide range of event sources and uses an event trigger mechanism that executes your code automatically in response to upstream events. A working ETL pipeline requires only a few lines of transformation logic and simple trigger configuration.
Typical use cases:
Decompress packages uploaded to Object Storage Service (OSS)
Clean log files or database records on ingestion
Consume and process messages from Message Service (MNS)
Key characteristics:
Wide event source support: Connect to OSS, MNS, and other event sources without managing polling or connection logic.
Custom processing logic: Define different transformation logic per event source or business scenario.
AI inference
Serving a trained model in production requires compute that sits idle between requests, scales to handle bursts, and lets ML engineers iterate on models without getting blocked by infrastructure. With Function Compute, pack a trained model into a function — the code runs only when a request arrives. Elastic scaling within milliseconds can allocate tens of thousands of vCPUs to handle request spikes, so compute capacity is not a bottleneck.
Key characteristics:
Focus on models, not clusters: Function Compute manages cluster O&M, freeing AI engineers to work on algorithm model training and business logic.
Elastic compute at scale: Automatic scaling within milliseconds; tens of thousands of vCPUs can be allocated on demand.
Safe model rollout: The versioning feature and canary release support let you run A/B testing on algorithms and reduce risk when launching a new model version.
Simplified dependency management: The upgraded toolchain simplifies installing third-party libraries such as TensorFlow and PyTorch, so you can deploy to the cloud with a few clicks.
Video transcoding
Video processing workloads are bursty: transcoding a single file is straightforward, but handling a large batch simultaneously requires compute that scales out instantly and costs nothing while idle. Combining Function Compute with CloudFlow gives you a serverless video processing pipeline with elastic scaling and high availability, without the operational cost of maintaining dedicated transcoding servers.
Key characteristics:
Custom transcoding logic: Configure custom processing logic directly in the transcoding function.
Parallel processing: Automatic scaling within milliseconds based on the number of video files, so multiple files are processed simultaneously.
Usage-based billing: No idle compute costs; billing scales with actual usage.
Low-friction FFmpeg migration: FFmpeg commands migrate directly to Function Compute, so existing FFmpeg-based services running on virtual machines move to serverless at low cost.
What's next
Quick start: Deploy your first function in minutes.
Event sources: See the full list of supported event sources and trigger types.
Billing overview: Understand how Function Compute is billed across different scenarios.