Teach you how to do Middleware Selection ------ news analysis

Messaging middleware selection analysis
 
table of Contents
I. Overview   
       What is the message middleware?
 
Second, using message queues scenes 
       Why use a message queue?
       Message Queuing what advantages and disadvantages?
 
Third, the popular message queue comparative advantages and disadvantages
 
IV Summary    
 
 
I. Overview   
       What is the message middleware?
Middleware message queue (referred to as messaging middleware) is the use of message passing efficient and reliable data exchange platform-independent, and for distributed system integration based data communication. By providing messaging and message queuing model, which may be provided in a distributed application environment decoupling, elastically stretchable, redundant storage, flow clipping, asynchronous communication, synchronization, and data functions as a distributed system architecture important components, has a pivotal position. Personal feeling parity scene has three core applications: decoupling, asynchronous, clipping.
 
Second, using message queues scenes 
       Why use a message queue?
In fact, this topic is often Inquirer interviewer questions, ask you what are the use of message queues scene, then your project's what the specific scene, you talk about what is the message queue in this scene
Expect an answer is, what your company has a business scenarios, this business scenario there is any technical challenge, if not MQ can be cumbersome, but now you bring with you after a lot of benefits MQ
Now think about how you can lower your answers to these questions, remember? Well I am here to introduce several common usage scenarios, reminded. . .
Decoupling: Live Draw a map to explain,
 

 

 A system sends data to the BCD three systems, interface call is sent, that if E systems have this information? If the C system that now do not need it? A second system now have to send data out? A system is responsible for people on the verge of collapse. . . Some more crashes more thing, A system should always consider if the system hung up BCDE four supposed to? I do not want to resend? Shall I save up the message? White hair ah. . .

 

 This is what you need to consider whether there is a similar scenario in charge of your system is a system or a module, called multiple systems or modules, calls between each other is very complex and cumbersome to maintain. But in fact, this call is no direct call interface synchronous, asynchronous him if MQ and decoupling, is also possible, you need to consider in your project (Micro Services of the students have done here is not under consideration the message bus for communication with Rabbitmq do decoupling between change or broadcast service configuration file?), it is not possible to use the MQ system decoupling. Reflected this stuff in your resume, using MQ as decoupling.

Asynchronous : Live Draw a map to explain,

 

 

 

 

A system receives a request, it is necessary to write in their local library, the library also need to write the three systems in the BCD, write your own local library to 3ms, BCD three systems were written libraries to 300ms, 450ms, 200ms. The final request total delay is 3 + 300 + 450 + 200 = 953ms, close to the 1s, the user feels put forward something, slow dead slow death.
Change to the asynchronous message queue when the message is sent to the corresponding system itself so that it can consume the user experience for 20 + 5 = 25ms, fast so fast!
Clipping: 0:00 to 11:00 every day, A calm system, the number of concurrent requests per second to 100. The results of each 1 to 11 o'clock to 1:00, the number of concurrent requests per second suddenly surge to 10,000. But the system has a maximum processing capacity can only be processed 1000 requests per second ah. . . Embarrassing, the system will die. . .

 

 

 

 

Message Queuing what advantages and disadvantages?

Advantage has been said above, is to have its corresponding benefits in Special Scenes decoupling, asynchronous, clipping

 

Disadvantages? Obvious

 

 

Reduce system availability: the more dependent on external systems introduced, the more easy to hang, you had A system call interface is BCD three systems like, four people ABCD system properly, nothing issue, you add a partial MQ come in, if MQ hung up zezheng? MQ hung up, the entire system crashes, you do not what would be finished.
 
Increase system complexity: add MQ abruptly come in, how do you ensure that the message is not repeated consumption? How to deal with the case of message loss? How to ensure that the order of message delivery? The bulk of the big head, a lot of questions, endless suffering
 
Coherence: A system to process over direct return is successful, people think that you request will be successful; but the problem is that if the three systems where BCD, BD two write library system is successful, the results of C write library system failed , Zezheng? You data is inconsistent.
 
So the message queue is actually a very complex architecture, you introduced it has many advantages, but also have to do all kinds of additional technical solutions and architecture for the harm it brings to circumvent the fall, after the best you'll find, mom die, to enhance the complexity of the system a number of stages, the complex may be 10 times. But the key moment, use, or use statistics. . .
Popular message queue comparative advantages and disadvantages
kafka, activemq, rabbitmq, rocketmq has what advantages and disadvantages ah?
Common MQ fact these types, there are many other other MQ, but more popular, so do not say
As one yard farming, at least you have to know the advantages and disadvantages of various mq right, let's take a look at the table to draw
After conclusion, a variety of comparison, as summarized below:

General business systems to be introduced MQ, the earliest we all use ActiveMQ, but now we do not much use, no proven large-scale throughput scene, the community is not very active, so we still forget it, I personally do not We recommend the use of this;
Later, it began to use RabbitMQ, but it does prevent a lot of erlang language java engineer to control his in-depth study and, for companies, almost in an uncontrollable state, but who is really open source, relatively stable support activity also high;
But now do more and more companies will go with RocketMQ, really good, but I want to remind myself good community risk in case of a sudden yellow out of their own company's technology strength have absolute confidence, I recommend using RocketMQ, otherwise, go back and honestly with RabbitMQ it, who is active in the open source community, will not yellow
So small and medium companies, technical strength is more general, the technical challenges are not particularly high, with RabbitMQ is a good choice; large companies, infrastructure, strong R & D strength, with RocketMQ is a good choice
If it is calculated in real time big data field, log collection and other scenes, with Kafka is the industry standard and is definitely no problem, a high degree of community activists, will not yellow, not to mention the fact that almost the norm all over the world in this field
 
Fanger Wei code scan to get more knowledge and learning materials
 
 
 
 
 

Guess you like

Origin www.cnblogs.com/1013wang/p/11714910.html