Author: Q Si.
The microservice architecture fully improves the efficiency of R&D and solves the problem of rapid iteration of complex business systems. However, as business and technology evolve, various microservice components become more complex. There are still many challenges in how to achieve more agile development, reduce the cost of microservice development and O&M, achieve full-link flexibility, and ensure the stability of the entire system.
For example, in the absence of unified specifications or collaboration between multiple development teams, there will be inconsistencies in the versions of microservice components and SDKs, but considering factors such as version compatibility and the scope of upgrades, many users dare not upgrade and bury hidden dangers. When you plan capacity, it is difficult for you to assess the appropriate resource requirements based on your business volume, and the cost of using large-scale instances is too high, and the bursts of traffic with small-scale specifications will affect the stability. If the business is developed by an ISV, after the project is delivered and accepted, the O&M responsibilities of some basic components are not clear, and if there is no professional inspection, monitoring and alarm mechanism, it is easy to cause online faults.
As a major trend in the evolution of microservice architecture, serverless technology can maximize technical dividends and resource utilization to solve the above problems. It allows developers to focus on business implementation, rather than worrying about where the underlying servers are, whether resources are sufficient, and when to scale up or upgrade.
In terms of R&D collaboration and iterative efficiency, microservices themselves are highly cohesive and reusable, and with serverless infrastructure, they can be upgraded to composable R&D. At the same time, users can use the full-link traffic control capability of microservice governance to quickly build a logically isolated daily environment, which reduces the construction time of the development and testing environment from days to minutes while saving resource costs, greatly liberating the productivity of developers. For basic components such as gateways, registry and configuration centers, MQs, databases, and Redis caches, it is obviously not economical to ensure their stability through resource redundancy.
With serverless cloud products, you can quickly realize full-link resource elasticity and enjoy O&M-free capabilities such as automatic upgrades. These foundational components are provided as a service, so developers don't need to get bogged down in complex configuration integration and focus on development tasks. For the business side, even after the ISV delivers the project and withdraws, there is no need to worry about the operation and maintenance, technical back-up, and stability guarantee of the basic components.
In line with this technology trend, Alibaba Cloud MSE is the first in the microservice industry to launch the serverless edition. It has three major functional highlightsThe first is adaptive elasticityThe cloud-native gateway and registration configuration center can automatically scale up or down according to the business volume, eliminating the need for complex capacity planning. For the registry configuration center, its resource consumption is related to several factors, such as the number of service providers, the number of client connections, and TPS. However, some indicators are difficult to observe and plan ahead. As a key traffic entrance, the gateway can provide daily business traffic, but it is difficult to judge unplanned traffic. Through the adaptive elasticity of cloud services, the stability of the entire technical architecture and the controllable cost can be ensured.
The second point is out-of-the-box O&M-freeGreatly reduce the O&M burden of users. MSE summarizes key events such as instance changes, node start-ups, and shutdowns, application online and offline, and current throttling into a unified view for the registration and configuration center, cloud-native gateway, and service governance, which is convenient for problem analysis and troubleshooting. MSE Serverless instances perform pre-checks and automatic upgrades during user-defined O&M periods. It not only ensures that the components are in the latest stable version, but also relieves users' worries about compatibility or the impact of business traffic. In addition, many users lack the awareness or experience of configuring alarm rules, MSE Serverless instances also support default alarm configuration, and when some serious events occur, users will be notified as soon as possible and intervened in time.
Last but not least,MSE Serverless billing is associated with business volume, and the threshold is lower. Common instances are charged according to fixed specifications, which will actually waste resources for small-scale businesses in the early stage of entrepreneurship or during off-peak hours. MSE Registration and Configuration Center Serverless is billed based on the number of client connections, and Cloud-native gateway Serverless is billed on a request-based basis, which will save a lot of costs for test environments, tidal services, and small and medium-sized businesses.
If you want to build a full-stack, highly elastic microservice architecture, you need to weigh the ease of scaling of each component, the speed of scaling, and the rate of change of business load. If you use MSE Serverless Edition and combine it with the capabilities of other Alibaba Cloud products, you can easily achieve the above goals. As shown in the following figure, user traffic enters the serverless instance of the cloud-native gateway through NLB and is routed to the application deployed on ACK or SAE, and the products on the entire link have adaptive elastic capabilities.
As the number of application replicas increases with business traffic, the number of connections and TPS to access the registry and configuration center will also increase, and Nacos and ZooKeeper serverless instances will also be auto scaled accordingly. For service governance, it is application-level on-demand access, and when service governance is enabled for an application on the SAE or ACK, the expanded application replica automatically enjoys the service governance capability. At present, Alibaba Cloud has more than 20 serverless products, and will continue to promote the comprehensive serverless core products. With serverless cloud services, users can build an overall highly elastic and low-cost microservice architecture.
The following is a test case to show how a cloud-native gateway serverless instance works with an ACK container cluster to use the QPS metrics in logging and the container HPA mechanism to achieve overall scaling based on the request volume.
For the application workload deployed in the container cluster, we create an HPA resource, set the minimum and maximum number of replicas, define QPS as a metric, and trigger scaling when the average QPS of each replica reaches 50.
After running the stress testing tool for 10 minutes, the number of requests sent to the gateway ramped up from 400 TPS to 4000+ TPS. You can see that all stress test requests are 100% successful, and the average RT remains at the level of 9 10 ms. In fact, the gateway service and the application replicas in the container cluster are automatically scaled out, and the entire process is completely transparent to users and the service is not aware.
Although MSE serverless has many advantages, it should also be selected according to scenariosHere we list the similarities and differences between the functions and applicable scenarios. In terms of high availability, both instances support multi-AZ deployment of multi-node clusters, with slightly different SLAs. In terms of O&M, you need to manually upgrade the version of a common instance, pay attention to the underlying resource monitoring metrics, and manually change the configuration in a timely manner when the threshold is reached. Serverless instances are automatically upgraded and scaled auto-scaling, so you don't need to do complex capacity planning, manual configuration changes, or worry about monitoring and alarming resources such as CPU and memory.
For cloud-native gateways, common instances support a slightly larger variety of communication protocols and authentication, and have hardware acceleration and scalability capabilities. Serverless instances also support mainstream protocols and authentication methods, which can cover most user requirements.
To sum up, serverless instances are more oriented to small and medium-sized businesses, intermittent tidal scenarios, and test environments. And users want to be O&M free and use back-end services more simply. Common instances are for users who want to control part of the O&M work and have more autonomy and scalability requirements.
Regardless of whether you build a self-built instance or use a common instance, you generally purchase specifications based on high business loads and pay for fixed resources. In this way, more resources are wasted during the trough period, and the overall cost is higher. If there is an unexpected large amount of business traffic, insufficient resources will cause business damage. Serverless instances can be scaled up and down quickly and independently, quickly responding to business changes, and reasonably optimizing usage costs, helping enterprises reduce costs and increase efficiency.
Serverless instances in the registration and configuration center are billed according to the total number of connections from the client to the server, with a billing unit for every ten connections, tiered pricing, and hourly billing, as shown in the following figure. Assuming that the user's business volume is stable, as shown in the line chart, the orange line represents the monthly price of serverless instances, and the blue line represents the monthly price of the Professional Edition cluster of ordinary instances. If the number of connections per hour is ten or less, the monthly fee for a serverless instance is 115 yuan. Even if the business volume reaches 50 connections, it is lower than the cost of Nacos or ZooKeeper open source self-built. Within 100 connections, serverless instances are less expensive than ordinary instances, so they are better for small and medium-sized businesses.
Cloud Native Gateway serverless instances count the number of requests processed per hour, with a billing unit for every 10,000 requests, tiered pricing, and hourly billing, as shown in the following figure. Assuming that the user's business volume is stable, as shown in the line chart, the orange line represents the monthly price of serverless instances, and the blue line represents the monthly price of common instance clusters. The cumulative number of requests per hour is less than 50,000, and the cost of serverless instances is lower than that of open-source self-built, and the cost is less than 200,000 requests, which is lower than that of ordinary instances.
The above assumption is that the business volume is small and maintained at a certain level, and in addition, the cumulative cost of serverless is also lower for intermittent and tidal scenarios. As shown in the bar chart below, if the business volume changes significantly within 10 hours, the number of requests per hour is 200,000 to 300,000 at the beginning, and the peak is 2 million per hour, and then gradually declines. For gateways, which are key entry points, common instances need to reserve resources to ensure that they can support the peak of 2 million requests. However, for serverless instances, its cost varies with the volume of business. While the hourly cost of a serverless instance is higher during peak hours, it is clear that it is more costly when the cost is added up for the entire period.
MSE Serverless Edition was officially commercialized on November 17, and the corresponding savings plan was launched, which allows users to commit to a certain amount of consumption per day to prepay according to the daily fees of the registration configuration center and cloud native gateway serverless instances, and can enjoy deductions ranging from 2% to 95%, which can further reduce the long-term usage cost of users. With a monthly consumption of less than 100 yuan, you can enjoy the three-in-one cloud-native gateway of K8S Ingress, microservice gateway, and security gateway, or a stable, secure, and maintenance-free registration and configuration center, so come and build your serverless microservice architecture
Related Links:
Introduction to MSE Serverless Instances:
Instance and version selection in the registration and configuration center
Enrollment Configuration Center Serverless Instance Billing Overview:
Cloud Native Gateway Instance Selection:
Cloud Native Gateway Serverless Instance Billing Overview: