You can implement backend web services by writing SCF functions and bind them with CLB instances to provide services.
Binding CLB instances with SCF functions is currently in beta. If you want to use it, please submit an application.
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. After creating a function, you can create a CLB trigger to bind the function and event. The CLB trigger will pass the request content as parameters to the function and return the result from the function back to the requester as the response.
Flash sales have high requirements for the application flexibility of the overall resource, and are closely related to the main business scenarios. SCF is generally a relatively independent module in a business system, which is convenient for migration and transformation. You can seamlessly apply SCF through CLB. For billing based on the number of service calls, the overall pricing and migration costs are relatively lower. In addition, cross-origin resource sharing over the same domain name can be easily achieved.
SCF can be applied with CLB for your web businesses, such as the order system, data collection system, BI analysis, and other minor business scenarios in which the traffic peak shifting is important, enabling a cost-effective business migration.
When the number of requests is high, targeted distribution of requests to the website can be achieved by differentiating the static and dynamic requests, effectively reducing the backend load pressure. The dynamic requests can be processed by separately deployed CLB instances and associated SCF functions; while the static content can be connected to CDN and optimized by COS to significantly improve the loading speed.
For businesses highly related to regions, you can use CLB instances to differentiate access based on regions for SCF.
Log in to the CLB console.
On the Instance Management page, click Configure Listener on the right of an instance.
In the HTTP/HTTPS Listener section, select the listener to be bound with an SCF function. Click the + icon on the left of the listener and the domain name under it, select the URL path displayed, and click Bind.
In the pop-up window, select SCF as the target type, set the configuration items, and click Confirm.
On the Listener Management tab, click the function name in the Forwarding Rules section.
Edit the function code on the Function Code tab. Content needs to be returned in the specific response integration format. For more information, please see CLB Trigger.
You can also create a CLB trigger in the SCF console to bind the CLB instance with an SCF function. For more information, please see Creating Triggers.