Concurrency Model | Single instance, single concurrency | Single instance, multiple concurrency |
HPA Mode | The Cloud Functions platform scales based on concurrency and supports pre-provisioned concurrency | Leverages the HPA capability of the deployment platform, e.g., the Kubernetes container platform can configure HPA based on CPU/MEM |
Memory Limit | Supports MEM size limits | Controlled via the runtime platform |
CPU Limit | Unaware of CPU core count | Aware of CPU core count, controlled via the runtime platform |
Timeout Control | Supports timeout control for function execution; execution can be terminated after timeout | Supports timeout control for function invocation; function code can continue to run after timeout |
Debugging Capability | Local debugging is difficult | The framework supports local execution and hot restart, making debugging easier |
Development Experience | Inconvenient for local development | More convenient for local development, provides ts type support |
Logs | Provides invocation records and advanced logs | Provides access logs and advanced logs; access logs offer users more detailed information |
Dependency Installation | Supports cloud-based npm dependency installation | Supports cloud-based npm, yarn, and pnpm dependency installation |
Runtime Version | Platform-provided specific node.js runtime version | Any node.js runtime version that meets the minimum requirements can be used |
Cold Start | Cold starts occur with shorter duration; cold start rate can be reduced through pre-provisioned concurrency | Cold starts occur with longer duration; can be avoided by configuring minimum instance count to prevent scaling to zero |
Resident Instance | "Not supported" (unaware of function instances) | Aware of the instance concept; instances can be configured to be resident or not |
Provisioned Concurrency | Supported | Not applicable, similar to manual scaling out |
Long Connection Capability | Not supported | Supports long connections via SSE and WebSocket |
Database Connection | Based on a single-instance, single-concurrency model, which is not conducive to long-lived database connections | No difference from a regular node.js program |
Asynchronous Function | Supported; static configuration cannot be dynamically switched, with execution duration limitations | Supported; function code can self-control whether to execute asynchronously |
Asynchronous Tasks | Partially supported in some versions | Supported; function code can self-control whether to execute asynchronously |
File Upload | Not supported | Supports form-data and other HTTP native binary upload capabilities |
File Download | Not supported | Supported |
Streaming Response | Not supported | Supports streaming response via Stream |
Built-in Routing | None | The framework features built-in routing, supports multi-function startup, enables easier code sharing between functions, and allows in-memory data sharing between functions |
Single-instance Multi-function | Not applicable | Supported; multiple functions can run within a single instance, facilitating code sharing and project management |