Given the characteristics of Serverless Computing, we propose the following usage recommendations:
Compose your function code in a stateless style, ensuring that your code does not maintain any state. Both local storage and memory results are potentially volatile, hence, services like COS, Redis/Memcached should be utilized to cache intermediate information and record the final computation results.
Instantiate any potentially reusable objects, such as database connections, outside of the execution method.
It is imperative to set the
+rx (read and execute) permissions for your files in the uploaded ZIP to ensure the executability of the code.Incorporate as many log/print statements as possible in your code to provide ample information for debugging purposes.
Tencent Cloud SCF can be connected to various Tencent Cloud services to build a wide variety of solutions as shown below:
Connected Service | Solution |
Serverless Cloud Framework | |
| |
| |
| |
| |
API Gateway | |
| |
| |
| |
| |
| |
Mini Program Cloud Development TCB | |
Tencent Real-Time Communication (TRTC) | |
| |
| |
| |
COS | |
| |
| |
| |
| |
| |
| |
| |
| |
CKafka | |
| |
| |
| |
CLS | |
| |
| |
| |
CLB | |
Media Processing Service (MPS) | |
| |
CDN | |
CDWPG | |
VOD | |
SMS | |
Elasticsearch Service | |
Scheduled action | |
| |
| |
Subscribe to the Serverless Technology Column to stay updated with the latest practices and Tencent Cloud Serverless news.
Description
In the following specific practices, functions are mostly deployed through template functions. You can download the code for analysis and learning. Both template functions and code support download operations.