Last updated: 2020-09-08 14:50:03

    Tencent Cloud Serverless Cloud Function (SCF) is a serverless execution environment that enables you to build and run applications without having to purchase and manage servers. It is an ideal computing platform for use cases such as real-time file processing and data processing. Simply code in a supported language and set the execution conditions, and your code can be run on the Tencent Cloud infrastructure elastically and securely.

    Evolution of Computing Resources

    With the development of cloud services and the high abstraction of computing resources, Tencent Cloud provides a wide variety of computing resource options from physical servers to cloud-based functions at different abstraction levels.

    • Cloud Physical Machine (CPM): scaling is at the physical machine level. You enjoy the physical computing resources exclusively, which provides the best security.
    • Cloud Virtual Machine (CVM): this virtualizes hardware devices, and scaling is at the virtual machine level. You share the physical machine resources with other tenants, and you can configure CVM metrics on your own, which is simpler than deployment and iteration.
    • Container: this virtualizes operating systems, and scaling is at the service level. The test and production environments are exactly the same, making testing and deployment very convenient.
    • SCF: this virtualizes runtime environments, and scaling is at the function level. This is the smallest unit of existing computing resources, which features full automation, one-click deployment, and high scalability, and is an ideal choice for lightweight service deployment.


    Serverless does not mean that there is no server. It is just that you do not need to care about the underlying resources, log in to a server, or optimize the server. You only need to care about the core code snippets while skipping the complex and cumbersome basic work. These code snippets are completely triggered by events or requests, and the platform automatically adjusts service resources in parallel based on the requests. The serverless architecture has near-infinite scalability, and no resources will be executed when idle. The code is executed in a stateless manner, which easily enables fast iterations and rapid deployment.

    SCF Overview

    SCF is a serverless execution environment provided by Tencent Cloud. All you need to do is write simple and single-purpose functions and associate them with events generated by your Tencent Cloud infrastructure and services.

    When using SCF, all you need to do is write the code in a programming language (Python, Node.js, PHP, Go, Java, or Custom Runtime) supported by the platform. The underlying computing resources and tasks are fully managed by Tencent Cloud, including maintenance of server CPUs, memories, networks, and other configurations/resources, code deployment, elastic scaling, load balancing, security upgrade, and resource execution monitoring. However, this means that you cannot log in to or manage servers or customize the system or environment.

    SCF is automatically deployed in multiple AZs in the same region with extremely high fault tolerance achieved. When a function is executed, scaling will be made based on the request load with no manual configuration or intervention required, helping meet the needs for service availability and stability in different scenarios. From several requests per day to thousands of requests per second, SCF can automatically scale at the underlying layer. You only need to pay for running functions, and if no function is running, no fees will be incurred.

    You can customize the timing of running a function, such as when a COS bucket is uploaded, when a file is deleted, or when an application is called through an SDK. You can also configure the function to run regularly. Therefore, SCF can be used as a data processing trigger for the COS service to easily implement IFTTT logic. Scheduled automated tasks can also be flexibly built to free you from manual operations and easily construct an elastic and controllable software architecture.

    SCF Features

    Serverless helps you get rid of the tedious development and configuration work, so that you can only care about the writing of business code logic, without any infrastructure construction, management, and OPS overheads. This service model lowers the threshold of R&D and improves the efficiency of business construction; therefore, it has gained the recognition of high numbers of enterprises and developers.

    Although serverless is the trend of the next-gen cloud computing services, its current service model cannot fully implement complex enterprise business systems for the following reasons:

    • Performance problems in face of cold start delay of synchronous businesses, scaling of high-concurrence function instances, and clustered management of function instances for large-scale businesses.
    • Lack of mature developer ecosystem. For example, if enterprises and R&D personnel adopt the serverless architecture, they will need support from upstream and downstream components such as monitoring, debugging, and DevOps.
    • High learning threshold. On the one hand, users need to transform existing businesses according to the logic of cloud-based functions. On the other hand, the event data model is not friendly to web scenarios. Users are more accustomed to writing business code directly based on HTTP requests and responses.

    In response to the current issues in the industry and based on its continuous technological exploration and research, Tencent Cloud has released the next-gen serverless computing platform: Tencent Cloud Serverless 2.0.

    In addition to solving the problems described above, Serverless 2.0 also focuses on your entire software development lifecycle from local development and code debugging to continuous business integration, launch, and OPS. Around serverless products, Tencent Cloud has built comprehensive capabilities for development support, DevOps, and OPS monitoring to help you better migrate to the serverless architecture and use it to sustain your core businesses.

    Low latency and unlimited runtime

    In Serverless 2.0, Tencent Cloud has not only thoroughly reconstructed and optimized the modules, virtualization layer, network layer, and scheduling layer of the control flow and data flow, but also comprehensively upgraded their security, availability, and performance. Through the use of lightweight virtualization technology, VPC proxy forwarding solutions, and other optimization measures, it implements a unified underlying architecture. Moreover, it has optimized the core ability to automatically scale in real time, completely avoiding the much criticized cold start problem in the traditional serverless architecture.

    SCF eliminates the limit on runtime and supports a richer set of application scenarios; for example:

    • Service functions do not limit the duration of a single request. When requests keep arriving, the service will maintain a persistent running mode with no delay in warm or cold start.
    • Service functions support WebSocket persistent connection.
    • Event functions (trigger-based functions) have a limit on single invocation duration, but when requests keep arriving, the service will maintain a persistent running mode with no delay in warm or cold start.

    Complete development, debugging, DevOps, and monitoring tools

    The Tencent Cloud Serverless team works in many ways to provide convenient tools or capabilities that can meet the needs in a wide variety of development scenarios; for example:

    • You can use command line tools to create, debug, and package projects in your local development environment and then quickly deploy them online.
    • With the aid of visual operations based on the VS Code plugin and IDE, online/offline management of functions and code writing and debugging can be performed at one single place. The VS Code IDE and plugin also enables local management, development, and debugging as well as online release of functions.
    • Web IDE is supported; therefore, you can develop and debug projects in real time in the console, which delivers the same experience as local development and debugging and makes it easier for you to view and adjust code.
    • For code that has already been hosted in git, you can connect your team to the git. Through the interconnection with your git and the feature of online installation of dependent packages, a simpler code submission and deployment method is realized, and the operation process is simplified.

    In addition to providing cloud-based logging and monitoring services and supporting various querying, filtering, and alarming features based on logs and monitors, Tencent Cloud has also improved the debugging capabilities of the tools; for example:

    • Through invocation chain tracking, you can track all the products, services, or functions a request passes through.
    • Through fault scene capture, you can capture the scene and events when a function fails, which facilitates code fault analysis.
    • Through application performance analysis, you can understand the performance of the code or modules inside your functions so as to further improve your application performance.

    The collaboration of multiple monitoring tools enables you to better develop, debug, launch, and release your products and services. Such tools provide more analysis and troubleshooting support while improving the transparency of operations and reducing the investment in OPS of the serverless architecture.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback