Today, when new retailing becomes a major trend, catering industry also joins in this wave. Intelligent catering system will help the catering industry to enhance its operational capacity and revenue from multiple dimensions, and building SaaS capability of intelligent catering system has become a hot spot. Zhao Yanan, Vice President of R&D, the co-founder of Nutnut Software in this article, 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 describe the solution using POLARDB and the whole process of migration. Finally, we will share the effect 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, Nut Software became the first customers of Aliyun because of this product. In the process of using Aliyun, we have learned more about these cloud products. At present, the overall technical 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, Nutnut Software participated in the development of SaaS-based software in the catering industry, “Customer to Cloud Catering”. Customer arrival mainly implements SaaS catering solutions, including ordering, cashier, finance, kitchen management and marketing, employee performance appraisal, etc.
“Guest arrival” through intelligent, digital catering service software, can help restaurants better improve operating efficiency and service quality, so that customers really enjoy the services brought by the catering industry. Intelligent ordering and cashier can help restaurants to reduce the cost of manpower and time. Intelligent catering system can let restaurant staff 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 SaaS, but for catering industry, traditional membership marketing 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, which requires more real-time reports. 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.
“Guest-to-guest” Development Path 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. In addition, 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. In this way, if we serve 10,000 restaurants, the order volume will reach 1 million per day, and the annual order volume 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 have high concurrency at peak time. 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, when the number of users is small, they can wait for users to release new versions when they are not available. When the number of users increases, it is found that such idle time has no longer existed.
When we first designed the catering software, we thought that SaaS could be realized as long as the restaurant had network. However, it was later 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, customer arrival realizes the local structural adjustment, can achieve even if the network is disconnected without affecting the continued operation of business processes, users can achieve no perception of the network situation, which can be achieved in Friends and Businessmen is not much, 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, the requirement for the timeliness of business adjustment is getting higher and higher. In addition, the product line is becoming more and more abundant, from three products rapidly expanded 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 Ali cloud monitoring, the alarm information of CPU and memory during peak period can be sensed in time, and then the processing of servers or server groups can be increased. 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 will also exist. Although slow query will not affect the normal operation of business, it will always bring some bad user experience. In view of the above situation, it is necessary to add some indexing mechanism and caching layer, archive some historical data, split some businesses, 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. Therefore, it is more desirable to concentrate technical energy on the development of product business, to do a good job of products and to 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, in addition to the need to solve the current problems, it also needs to be able to support business expansion within two years, although there will be architectural evolution in the middle, but for the architect, it needs to have a bottom in mind. In addition, a good product can certainly provide good performance, while the cost needs to be controllable and budgetable.
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, the front-end server will be reached, and the front-end server and the rear-end server will be separated again through the load balancer 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 can effectively alleviate the pressure at the database level, but it also needs to pay attention to its own characteristics when using, such as bandwidth limitation and logical need to be consistent with the storage layer. The storage layer used RDS before, and now uses POLARDB instead. The relational storage was basically solved through a main RDS and several RDS read-only nodes, which can backup the historical data of the order asynchronously. 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 widely used products, so as to achieve early monitoring and early warning of problems. When designing an architecture, the architect needs to constantly tease out the architecture so that it can be easily analyzed and judged whether the architecture can be migrated 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. So it is necessary to evaluate the system migration in practice. After that, in order to dispel the concerns of R&D and products about new technologies and products, we need to do adequate preparation and testing. For example, for the application of POLARDB, we need to test the performance adequately, such as 100% compatibility with MySQL, and we also need to test the whole process of the business. After the completion of the test, we need the first time. Line test feedback. After migration, we need to evaluate the effect. After migration to POLARDB, Guest-to-Guest found that page response speed was improved by 80%, complex SQL processing performance was improved by 200%, and the cost was reduced by 20%. And the whole migration process only used more than one hour, the production environment is currently running smoothly, and the business code did not make any changes, only made 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 make good network planning and grasp the time point. In addition, we need to pay attention to the change of whitelist, because when the whole network architecture changes, the change of external IP may affect third-party interface calls.
Author: Tongbi 2018
Read the original text
This article is the original content of Yunqi Community, which can not be reproduced without permission.