Article From:https://www.cnblogs.com/yunqishequ/p/9968147.html

Today, with the new retail sales becoming a major trend, the catering industry has also joined in this wave. Intelligent catering system will help the catering industry to enhance its operational capacity and revenue from multiple dimensions, and building the ability of SaaS intelligent catering system has become a hot spot at present. Co-founder of Nut Software in this paperAm; Zhao Yanan, vice president of R&D, has brought you a practical sharing on building customer-to-intelligent catering system using Aliyun POLARDB.

_

In this sharing, we first introduce the SaaS product of “Customer-to-Cloud Catering”. Secondly, we introduce the challenges that need to be faced with with the development of business and why “Customer-to-Cloud Catering” should choose POLARDB. Thirdly, we will talk about the solution using POLARDB and the whole process of migration.Finally, we will share the results of upgrading the database architecture to POLARDB.

Nut Software and Background Introduction of “Customer-to-Cloud Catering”

As early as 2008, Nut Software was the first software developer of Taobao Service Platform. At that time, it made “Maiduo” products. It is precisely because of this product that Nut Software became the first customers of Aliyun. In the process of using Aliyun, we have learned more about these cloud products and the overall technology at present.The architecture is based on Aliyun. The advantage of using Aliyun products for kernel software is that it saves a lot of operation and maintenance costs, and enables technical teams to focus more on the development of their own products and business. Four years ago, based on Aliyun’s experience and understanding of the software, Nut Software participated in the catering industry.SaaS software “customer to cloud catering” development. Customer arrival mainly implements SaaS catering solutions, including ordering, cashiering, finance, kitchen management and marketing, employee performance appraisal, etc.

“Guest arrival can help restaurants to improve their business efficiency and service quality through intelligent and digital catering service software, so that customers can really enjoy the services brought by the catering industry. Intelligent ordering and cashier can help restaurants to reduce labor costs and time costs. Intelligent catering system canEnough for restaurant staff to directly see all flow information in the report, making the reconciliation easier and easier. Restaurant chefs themselves are very busy, so with the help of intelligent after-kitchen management can help chefs make dishes orderly, and then improve the efficiency of after-kitchen. Membership marketing is a common function of SaaSYes, but for the catering industry, the traditional membership marketing method can not effectively attract customers. With the help of intelligent system, restaurants can carry out intelligent marketing inside and outside the store, making the activities more efficient and bringing more capital flow to the restaurant. Many catering enterprises pay more and more attention to real-time information, real-time reportsSex is more demanding. Therefore, the SaaS of catering industry can be carried out from such a starting point. In addition, “guest arrival” in the user experience has also done fine settings, more concise and practical. Through the cooperation of software and intelligent hardware, the catering industry can be better enabled.

“Customer-to-customer Development with the help of SaaS in Aliyun

The catering industry is characterized by high peak business, especially during lunch and dinner periods. Through the cloud monitoring of Aliyun background, we can see that in these two periods, the system pressure will increase substantially almost instantaneously, which requires the system to be able to cope with the peak situation well. Besides,Weekend nights will have larger peaks than usual, reaching 2 to 3 times the normal level. And the order data of restaurants is also very large, a normal Chinese restaurant will sell 200 to 250 orders per meal, and some fast-food restaurants will even reach 1000 to 2000 orders. So if you serve 10,000 familiesRestaurants, orders can reach 1 million a day, annual orders will reach 780 million. Combining the detailed data of the menu, the amount of data is very large. And because it involves information such as orders, members and promotions, the table structure will be larger, and these businesses will appear at peak times.High concurrency. In addition, due to the characteristics of the restaurant, the stability of the system is very high, basically can be said to be “365*24” hours of availability requirements. Because many restaurants not only provide lunch and dinner, but also night supper and breakfast. In the past, users can wait for hours that users do not have.When the number of users increases, it is found that such free time period no longer exists.

When we first designed the catering software, we thought that SaaS could be realized as long as the restaurant had network. But later it was found that even though the bandwidth was sufficient at the peak of the business, it was still very poor when accessing cloud data, and even interrupted, which affected the business. Based on this situation, the arrival of visitors has been realized locally.The structure adjustment can realize that even if the network is disconnected, it will not affect the operation of the business process. Users can realize no perception of the network situation. This is not much that can be achieved in Friends and Businessmen, so it also gains a good reputation.

With the growing volume of business development, more and more users, increasing demand, business logic is becoming more and more complex. With the increase of various ways of ordering meals and various scenarios of ordering orders, the requirement for the timeliness of business adjustment is getting higher and higher. In addition, the product line is becoming more and more abundant, expanding rapidly from three products.To eight products. With the growth of business volume, historical data is also growing rapidly. Sometimes, because of the “slow SQL” in the cloud, there are some hidden problems. Through Aliyun monitoring, we can timely perceive the alarm information of CPU, memory and so on during peak period, and then add servers or services.Processing of device groups. In view of the above problems, we often do some corresponding analysis. From page loading, front-end to back-end database will be checked. In the aspect of system optimization, slow SQL will be found everyday to optimize, including RDS, slow query statistics will also exist, although slow query will not be affected.The normal operation of the sound business, but there will always be some bad user experience. In view of the above situation, we need to add some indexing mechanism and caching layer, archive some historical data, split some business, reduce the pressure of single tables, and make the business architecture clearer.

Although the above technical problems will not affect the normal operation of the business, the limited R&D effort is always hampered by these technical problems, which will affect the speed and efficiency of the technical team in developing new requirements and functions. Especially for startups, R&D efficiency and user needs are the key points. becauseThis is more hope to concentrate technical energy on the development of product business, do a good job of products and serve customers. Reducing the workload of non-mainline R&D through better technology and products is also a concern for companies and architects. That is to say, besides solving the current problems, we need to be able to support them.Business expansion in the next two years, although there will be architectural changes in the middle, but for architects, need to have a bottom in mind. In addition, a good product can certainly provide good performance, while the cost needs to be controllable and budgetary.

For you to share a brief “guest to” based on Aliyun architecture design. First, from the beginning of user access, Aliyun provides domain name resolution services, CDN acceleration and Web application firewalls for network security. After domain name resolution, it goes to the front-end server, and through the load balancer willThe pre-server and post-server will be separated again to solve the concurrent requests at the application level. In order to solve the problem of Session sharing, the application server can use Redis to solve the problem, so that the outage of a single machine does not affect the user’s use, so as to achieve high availability. At the same time, Redis cache canEffectively relieve the pressure at the database level, but also need to pay attention to its own characteristics when using, such as bandwidth constraints and logical need to be consistent with the storage layer. The storage layer used RDS before, and now POLARDB. It used to use a master RDS and several RDS read-only nodes.It basically solves the problem of relational storage, and can complete the asynchronous backup of the historical data of the order. Storage of files and pictures can be placed on Aliyun OSS, which is more cost-effective than on disk. In terms of security, cloud monitoring products are the most frequently used products, so that problems can be raised.Pre-monitoring and early warning. When designing an architecture, the architect needs to constantly sort out the architecture so that it can be easily analyzed and judged whether the architecture can be migrated or not during the evolution of the architecture.

“Practice of migrating guest-to-guest database architecture to POLARDB

When analyzing the feasibility of architecture migration, we should first evaluate the current architecture, the business involved and the host, ECS and OSS running. Therefore, in the actual system migration needs to be evaluated first. Later, in order to eliminate R&D and product adoption, new products were introduced.Technical and product concerns require adequate preparation and testing. For example, for the application of POLARDB, performance tests, such as 100% compatibility with MySQL, full process testing of the business, and test feedback at the first time after the completion of the test are required.After migration, we need to evaluate the effect. After migrating to POLARDB, Guest-to-Guest found that the response speed of pages has been improved by 80%, the processing performance of complex SQL has been improved by 200%, and the cost has been reduced by 20%. And the whole migration process only took more than one hour to produce.The environment is currently running smoothly, and the business code has not been modified, only a simple replacement of the configuration file.

Finally, we share two key points in the process of database architecture migration. The first point is the migration of VPC. POLARDB uses VPC network connection, so when migrating, we need to do a good job of network planning and grasp the time point. In addition, attention should be paid to changes in the whitelistBecause when the whole network architecture changes, the change of external IP may affect the third-party interface call.

Original link
This article is the original content of Yunqi Community, which can not be reproduced without permission.

Leave a Reply

Your email address will not be published. Required fields are marked *