Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program cloud development important concepts


May 20, 2021 WeChat Mini Program Development Document


Table of contents


important concepts

Here are some important conceptual explanations for cloud development that are important for understanding cloud development and its development models:

1. Resource environment

An environment corresponds to a set of independent cloud development resources, including databases, storage space, cloud functions and other resources. T he environments are independent of each other, and users create an environment when they start cloud development, with up to two environments by default. I n real-world development, it is recommended that each formal environment be paired with a test environment, and that all functions be tested in the test environment before going to the formal environment. For example, two environments that can be initially created are recommended for one to be created as a test test environment and one as a release formal environment.

For developer debugging, starting with developer tools 1.02.1905302 and the base library 2.7.1, the default environment used in the SDK is output in the debugger after wx.cloud.init:

WeChat small program cloud development important concepts

At the same time, request details for each cloud development operation are output in the Network panel, including the environment ID requested by the call:

WeChat small program cloud development important concepts


2. Quota description

The resource quota

The following are various resource quota metrics for cloud development, with Tencent Cloud TCB providing storage and computing services. U sers can use this feature by downloading the latest WeChat developer tools. Resource quota can be divided into three categories: resource balance type, CDN resource consumption type, cloud function resource consumption type, database resource consumption type.

Resource equilibrium

Classification parameter Basic version 1 Basic version 2 Professional version 1 Professional version 2 Professional version 3 Ultimate 1 Ultimate 2 Ultimate 3 Enterprise version 1
storage capacity 5GB 10GB 50GB 100GB 300GB 500GB 700GB 1000GB 1300GB
Download operation 1.5 million / month 2 million / month 7.5 million / month 15 million / month 25 million / month 37.5 million / month 45 million / month 50 million / month 60 million / month
Upload number 600,000 / month 1 million / month 3 million / month 6 million / month 10 million / month 15 million / month 20 million / month 25 million / month 30 million / month
CDN backward traffic 1 5GB / month 10GB / month 50GB / month 150GB / month 300GB / month 500GB / month 600GB / month 800GB / month 1000GB / month
CDN CDN traffic 5GB / month 25GB / month 50GB / month 150GB / month 300GB / month 500GB / month 1000GB / month 2000GB / month 4000GB / month
Cloud function Resource usage GBS 3 40,000 / month 200,000 / month 400,000 / month 1.5 million / month 3 million / month 4 million / month 15 million / month 30 million / month 40 million / month
External network traffic 1GB / month 3GB / month 5GB / month 10GB / month 20GB / month 25GB / month 100GB / month 200GB / month 400GB / month
database capacity 2GB 3GB 5GB 10GB 20GB 10GB 50GB 100GB 200GB
At the same time 4 20 50 100 200 300 400 500 500 500
Read operating 50,000 / day 250,000 / day 500,000 / day 1.5 million / day 3 million / day 5 million / day 10 million / day 20 million / day 50 million / day
Write an operand 30,000 / day 150,000 / day 300,000 / day 1 million / day 2 million / day 3 million / day 5 million / day 10 million / day 30 million / day
Collection restriction 100 150 200 300 400 400 500 600 800
Total price free 30 yuan / month 104 yuan / month 390 yuan / month 690 yuan / month 860 yuan / month 2,499 yuan / month 4,699 yuan / month 8,999 yuan / month

CDN resource consumption

Classification parameter CDN version 1 CDN version 2 CDN version 3
storage capacity 50GB 100GB 500GB
Download operation 7.5 million / month 15 million / month 37.5 million / month
Upload number 3 million / month 6 million / month 15 million / month
CDN backward traffic 50GB / month 150GB / month 500GB / month
CDN CDN traffic 500GB / month 3072GB / month 10240GB / month
Cloud function Resource usage GBS 200,000 / month 500,000 / month 1.5 million / month
Out-of-network traffic 3GB/month 5GB/month 10GB/month
Database Capacity 3GB 5GB 10GB
The number of connections at the same time 50 100 200
Read the number of operations 250,000/day 500,000/day 1.5 million/day
The number of write operations 150,000/day 300,000/day 1 million/day
Collection restrictions 150 200 300
Price 149 yuan/month 690 yuan/month 2,199 yuan/month

Cloud function resource consumption type

Classification Parameters Cloud Function Version 1 Cloud Function Version 2 Cloud Function Version 3
Store Capacity 5GB 10GB 50GB
Number of downloads 1.5 million/month 2 million/month 7.5 million/month
Number of uploads 600,000/month 1 million/month 3 million/month
CDN back-source traffic 5GB/month 10GB/month 50GB/month
Cdn CDN traffic 5GB/month 25GB/month 150GB/month
Cloud function Resource usage GBs 400,000/month 4 million/month 15 million/month
Out-of-network traffic 5GB/month 25GB/month 100GB/month
Database Capacity 3GB 10GB 20GB
The number of connections at the same time 50 200 300
Read the number of operations 250,000/day 1.5 million/day 3 million/day
The number of write operations 150,000/day 1 million/day 2 million/day
Collection restrictions 150 300 400
Price 79 yuan/month 390 yuan/month 1,299 yuan/month

Database resource consumption

Classification Parameters Database Version 1 Database Version 2 Database Version 3
Store Capacity 5GB 10GB 50GB
Number of downloads 1.5 million/month 2 million/month 7.5 million/month
Number of uploads 600,000/month 1 million/month 3 million/month
CDN back-source traffic 5GB/month 10GB/month 50GB/month
Cdn CDN traffic 5GB/month 25GB/month 50GB/month
Cloud function Resource usage GBs 200,000/month 1.5 million/month 4 million/month
Out-of-network traffic 3GB/month 10GB/month 25GB/month
Database Capacity 5GB 50GB 200GB
The number of connections at the same time 100 400 500
Read the number of operations 500,000/day 5 million/day 50 million/day
The number of write operations 300,000/day 3 million/day 30 million/day
Collection restrictions 200 400 800
Price 69 yuan/month 590 yuan/month 1,799 yuan/month

In addition to the above quota parameters, the small program cloud development resources include the following system parameter limits (all version quotas follow the same system parameter limits):

  • Cloud function (single run) running memory: 256M5
  • Number of cloud functions: 50
  • Cloud functions: 10006
  • Database traffic: 16M for a single outing
  • Database single-collection index limit: 20
  • Small terminal request frequency limit for a single small program: 1 million times per minute

Note:

  1. CDN back-source traffic: The amount of traffic generated when the CDN back-source storage is turned on after CDN acceleration is turned on.
  2. Number of cloud function calls: The limit on the number of calls has been released, and now all packages are changed to unlimited calls
  3. Cloud function resource usage GBs: Resource usage - Function configuration memory X runs for a long time. U ser resource usage is calculated by configuring memory by a function, multiplied by the billing time of the function runtime, whereby the configured memory is converted to GB units and the billing time is converted from milliseconds (ms) to seconds (s), so resource usage is calculated in GBs (GB-seconds). F or example, a function configured for 256MB, with a single run of 1760 ms and a billing time of 1800 ms, uses (256/1024) of resources for a single run of (1800/1000) and 0.45 GBs. For each run of the function, resource usage is calculated and summarized on a monthly basis as resource usage for the month.
  4. Number of database simultaneous connections: The number of database requests that are connected at the same time, if there are thirty database operation requests at the same time, twenty will be executed simultaneously, leaving ten returns that exceed the number of simultaneous errors, one database request (whether initiated by a small terminal or a cloud function) will consume one connection, and each cloud environment will have a simultaneous connection limit and a separate count. If a database query takes an average of 10ms, a connection can support 100qps (1000ms/10ms x 100), and 20 connections can support up to 2000qps.
  5. Cloud function (single run) running memory: The maximum available memory at the time of the cloud function run is 256 MB. T he run memory information presented in the cloud function run log is the actual memory used at the time of the run. Actual memory usage may be lower than the maximum available memory and is calculated at 256 MB of configured memory.
  6. Cloud function simultaneous connections: The simultaneous connection limit has been released and all plans are now changed to a unified maximum of 1000

Service level agreement

Small Program Cloud Development provides storage and computing services by Tencent Cloud TCB, so Small Program Cloud Development follows the relevant provisions of the Tencent Cloud Development Service Level Agreement (SLA).

For customers who have purchased a cloud development plan and have in charged, if service availability is below standard, the developer has the right to claim compensation through the ticket for the corresponding account, in accordance with the compensation scheme in the service level agreement. Specific availability calculation rules, compensation standards and application methods are in accordance with the provisions of the Tencent Cloud Development Service Level Agreement (SLA).

Special instructions

  • From the time the paid function is online, the small program and cloud development quota adjustment application through the mailbox application will no longer be accepted.
  • The deadline for applying for adjustment of quotas by 2019-06-21 has been extended uniformly to 2019-08-31.