In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
How to achieve the rapid iteration of Mini Program, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
"the pain of rapid iteration: the inefficiency of traditional development models"
Before using cloud development, the front-end data depends on the back-end, and functions such as "data read and write" and "file upload" need back-end support. Multi-post development spends more time on the communication of the whole workflow, such as pre-communication, development joint adjustment, synchronous testing and so on, and the development cycle will take a long time.
The larger the team, the less efficient this development model is.
After the emergence of cloud development, the team development model has changed.
1. Save manpower cost
Cloud development allows front-end students to easily achieve database read and write, file upload and other functions, so we began to try to let front-end students to complete some projects independently. Mini Program pages like this check-in page and 10th anniversary are directly completed by the front-end. Save the cost of communication and joint adjustment, and the work efficiency has been greatly improved.
"what used to be done by two people can now be done by one person! "
This is a part of the scenario of independent services. Sometimes our back-end services need to be called by multiple terminals at the same time. Cloud development does not conflict with the use of own servers, and they can complement each other. Let's take a look at another scenario.
two。 Save computing resource cost
All kinds of customer acquisition and promotion activities of e-commerce Mini Program are indispensable. How to deal with the peak traffic during the event, such as our second kill and free pick-up, each activity is several times the usual traffic.
If it is its own server, it can only deal with the traffic peak by adding servers, which requires a lot of operation and maintenance costs and server costs. After the activity, these servers will be idle, resulting in a waste of resources. In fact, we can use the "auto scaling" feature of cloud development to implement data caching using cloud number functions and cloud databases.
Get the data from your own server on the first request, and then store it in the cloud database. Get the data directly from the cloud database when you request it again. You can also set an expiration time for the data. After expiration, you can pull the latest data from your own server and update it to the cloud database. Cloud development supports auto scaling and does not have to worry about high concurrency. Cloud development here is not only convenient, but also saves us money.
And the cloud function also supports the "timing trigger" function. If you make good use of the timing trigger function, you will find that it can be easily solved by using cloud development in many complex scenarios.
3. Save data aggregation architecture cost
E-commerce Mini Program has a variety of ways to play, and all kinds of promotion are one after another. Each promotion will realize the display of page data in a different way. The front end needs to face a variety of challenges, the page module has a large number of multi-interface requests, the interfaces depend on each other, and the data are interrelated.
For example, a "brand group" needs to first obtain a list of brands through the interface, and then get the recommended products of the brand through the product interface.
For example, the special show of "only goods warehouse" needs to obtain special data and user attention data respectively.
This scenario is called data aggregation, where data from multiple interfaces are aggregated and then displayed.
Data aggregation can be done at the front end, which is more flexible, but there are many calls to the interface and the page loading speed is slow, which affects the user experience. Data aggregation can also be implemented at the back end, the front end calls the aggregated data interface, and the number of front end calls to the interface is reduced, but this is very inflexible, and each promotion requires the back end to develop a new interface.
Let's take a look at how we implement data aggregation in complex scenarios.
Here we still use the cloud database for caching. But the difference is that we use two cloud functions.
Cloud function An is triggered regularly and is responsible for obtaining data from multiple APIs of your own server, aggregating according to the data format displayed on the page, and then storing it in the database.
SCF B simply reads data from the cloud database and returns it to Mini Program.
Why do you use two cloud functions here?
It is mainly considered in the following two aspects: first, multiple interfaces are generally requested in data aggregation, and the request time is generally longer; second, data aggregation generally needs to do a lot of logical processing, and separating data read and write functions can reduce logic.
After dealing with in this way, the complex logic becomes simple, and each link has its own job. On this basis, we have made adjustments to the entire structure of Mini Program.
Hierarchical architecture adds a middle layer in front of Mini Program and its own server to deal with the data differences between the two ends.
In this way, the entire architecture becomes much clearer after layering, and even complex businesses can be easily handled. Mini Program end only needs to pay attention to data presentation and interaction logic, the back end only needs to pay attention to its own services, and the middle layer does a good job of data processing. And you don't have to worry about slow requests.
After reading the above, have you mastered how to achieve the fast iteration of Mini Program? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.