Introduction: “small program Serverless cloud development”, small program Serverless training camp exclusive textbook! 7 days small program cloud development from 0-1 hand to hand teaching, learn the small program cloud indicators statistical analysis methods. What are you waiting for? Sneak peek, let’s learn!
Aliyun small program Serverless provides a set of back-end services including cloud functions, data storage, file storage and so on. Through API, developers can obtain cloud functions, data storage, file storage, audio and video, image processing and other services. They do not need to care about servers or underlying operation and maintenance facilities, and can focus on the code and business itself.

“Small program Serverless cloud development” e-book online, 5 small program development core technology +1 small program cloud data analysis method, take you 7 days to learn alipay small program cloud development!

! [](https://pic3.zhimg.com/80/v2-3f3ac64a7e0780e78f5e6537380b3875_720w.png)

directory

! [](https://pic1.zhimg.com/80/v2-16f2aa80dcbcd140e581118683a1901a_720w.png)

Content preview

Realize small program cloud opening

Aliyun small program Serverless provides the following functions:

• Data storage The data storage service is based on the MongoDB hosted database in the cloud, and the data is stored in JSON format. Each record in the database is a JSON-formatted object. A database can have multiple collections (equivalent to tables in a relational database). • File storage File storage services allow text, images, and other user-generated content to be stored in the cloud. Developers can use cloud storage on the applets and console. After the image is uploaded successfully, the system automatically generates a resource link. Developers can use this image address in the applet.

How do I operate the cloud database

Cloud database (data storage service) is based on MongoDB hosted in the cloud database, data is stored in JSON format. As a developer, you can manipulate data directly within the client or read and write data in the cloud functions. Serverless provides a simple JSON syntax to control user access to resources, similar to IAM in authentication system or ACL in network security. You can control table permissions by modifying permission rules. .

How to use cloud storage

The mpServerless. File object provides methods uploadFile and deleteFile to manage files. Uploaded files will be network accelerated through CDN. Serverless provides a set of simple JSON syntax to control user access to resources, similar to IAM in authentication system or ACL in network security. You can modify permission rules to manage file permissions.

How do I use cloud functions

Cloud functions (FaaS) are lightweight, unrelated, and reusable pieces of code that run in the cloud. There is no need to manage the server, just write and upload the code to get the corresponding data results. Using cloud functions enables enterprises and developers to focus more on the code and the business itself without having to worry about the server or the underlying operation and maintenance infrastructure, and further decouples the code and increases its reuse.

How do I use cloud invocation

Cloud call is based on the small program Serverless cloud function to the ability to use pay treasure to open small program interface, easy to let developers in small programs called directly open alipay backend interface, don’t need to pay attention to service the relevant configuration, greatly reduced the access process, further reducing the threshold of pay treasure to the development of small programs.

Teach you a cloud development tip

In cloud development tips, we’ll introduce you to:

  • Use cloud function HTTP trigger + cloud call to realize alipay payment function without back-end access, and receive payment callback function through cloud function;
  • The cloud function timing trigger is used to schedule tasks at dawn every day.

Implement statistical analysis of your applets

After the launch of the small program, if we need to monitor and statistics the number of startup times, new users, active users and other indicators, we can first create an application on the console, and then install the SDK of statistical analysis service in the small program project. To access alipay mini program for statistical analysis of user usage data, you need to complete the following operations:

! [](https://pic3.zhimg.com/80/v2-1dbe119fed6b926f230b41db928f646c_720w.png)

The original [link] (https://developer.aliyun.com/article/766426?utm_content=g_1000173377)

This article is the original content of Aliyun and shall not be reproduced without permission.