I don’t know if you have noticed the classification node of this article: cloud computing. In fact, my intention is to categorize microservices and cloud architecture together. Because they all have the same purpose: to facilitate expansion!

Expansion. For the system bottleneck, need to expand the system, congratulations, your system must be rapid development, encountered the increase in traffic!


[Cloud Architecture, system expansion case]

Let me start with my personal experience: I am a GPS alarm system, the hardware needs to send back data to the background server, so the better the hardware product sales, my system needs to face more and more pressure and challenges. Thanks for going through such a process, which makes me deeply aware of the great value of system expansion architecture design. In my project, I went through three stages:

Phase 1: Single machine phase

Single-machine applications, single-process applications, it turns out, can only support concurrent hundreds of devices.

By revamping multi-threading, the IOCP design model can support more than 20,000 concurrent processes

Bottleneck: It is difficult to break through the concurrency capability of single application, and every time we meet difficulties, we have to reconstruct. In my case, it was up to 30,000 loads, less than 500,000 loads!

Phase 2: Manually split multiple servers

Manual distributed separation design, web site, socket receiver program, cache, database, the use of self-built room to run independently. It turns out that hundreds of thousands of devices can be supported concurrently

Bottleneck: There is a limit on the number of concurrent connections in the firewall device of the self-built machine room. CISCO ASA 5515 firewall allows a maximum of 250,000 connections.

Phase 3: Cloud architecture phase

Cloud architecture design, by modifying the system, to achieve automatic capacity expansion. At this time, the number of client devices no matter how many, because ali Cloud after the SLB ECS server number can be added and reduced at any time, currently has reached more than 1 million devices concurrent connection without pressure.

Bottleneck point: Limited to me, the database pressure needs further optimization in the future, but at present there is no pressure from millions of concurrent devices, but ali Cloud’s distributed database DRDS seems to be able to solve my difficulty.


【 Micro-service, modular application case 】

In my case, I focused on the role of cloud architecture and did not focus on the role of microservices. But in fact, a little bit of microservice functionality has been used in several iterations:

Modular features, my case is based on the overall system split, in fact there is room for optimization is to transform into micro services. Examples of microservice applications:

Login system functions: at present, only a few hundred users can log in at the most. Login function code with the website overall release, load balancing needs to be maintained at a time to update dozens of web machines, obviously too redundant. If the “microservice” component of the login function were released separately, only two Web machines (” login dedicated servers “) would be dedicated to the login function. In the future, this part of the system pressure increases, just need to add a “login server”.

Query positioning function: everyone’s positioning page is in high frequency refresh visit, although only a few hundred people login, but the number of visits is up to tens of thousands of times. How to do? More than ten Web servers are specially taken out for “locating query servers”. In this way, if the monitoring of the positioning function has a problem, only need to check the problem from the ten “positioning query server”!

Conclusion: The purpose of microservices is the functional separation of software development. For using microservices: small projects are laborious, large projects are easy to use.

As a result, there are many opinions:

People who haven’t worked on big projects think microservices are a drag;

People in contact with large projects acknowledge the value of microservices, but do not recommend small projects to use microservices for “anti-aircraft gun shooting mosquitoes”.

People who have been doing high-traffic projects advocate the use of microservices.


【 conclusion 】

The value of micro-services: when the traffic volume increases in the future, the function of precise control of a bottleneck point is mainly reserved at the development level

The value of the cloud architecture is that the number of servers is directly increased to expand the system load threshold when the traffic volume increases, which is mainly reserved at the operation and maintenance level

Microservices + Cloud Architecture: an important combination of large systems!

The original address: www.opengps.cn/Blog/View.a… Updates and edits follow this link. Welcome to pay attention to the source station original article!