Message queue function introduction

Literally, message queuing is in the data structure “ fifo ” A data structure of , But if asked Eliminate single point of failure , Ensure the reliability of message transmission , Dealing with the impact of large traffic , The requirement of message queue is very high . Now the Internet “ Microarchitecture ” The rise of patterns , The original large centralized IT Service because of all kinds of disadvantages , Usually split into fine-grained multiple “ Microservices ”, These microservices can be in a LAN , It can also be deployed across machine rooms . On the one hand, the demand for loose coupling between services is higher and higher , On the other hand , There's a growing connection between services , Distributed message queuing can provide three important functions The application of decoupling Traffic peak clipping Message delivery , It has become a standard Middleware in large-scale Internet service architecture

  • 1. The application of decoupling

There are many subsystems in complex applications , For example, there is an order system in e-commerce applications , inventory system , Logistics system , Payment system . At this time, if the coupling between subsystems is too high , The availability of the whole system will be greatly reduced . Multiple subsystems with low error rate are coupled together , Get an overall system with high error rate . Take e-commerce applications , After the user creates the order , If the coupling calls the inventory system , Logistics system , Payment system , Any subsystem is out of service temporarily due to failure or upgrade , All of these will cause abnormal order operation , Affect user experience

Pictured 1.1 Shown , When it comes to message queuing , The availability of the system is much higher , For example, the logistics system fails , It will take a few minutes to fix , In these minutes , The content to be processed by the logistics system is cached in the message queue , The user's order can be completed normally . When the logistics system is restored , You can supplement the order information stored in the message queue , The end user can't perceive that the logistics system has failed for several minutes

  • 1.2 Flow peak elimination

Every year's double eleven , Many of Taobao's activities are 0 Turn it on when it's on , Most of the application system traffic will surge in an instant , If there is no buffer mechanism at this time , It is impossible to withstand the impact of short-term and large flow . Through message queuing , Storing a large number of requests , Spread over a relatively long period of time , It can greatly improve the stability and user experience of the system .

for instance , If the order system processes up to 10000 orders per second , This processing capacity is more than enough for the normal period of time , But when it comes to double ten one 0 a.m. , If you don't have message queuing as a buffer , To ensure the stability of the system , Users are not allowed to place orders after more than 10000 orders ; If there is a message queue for buffering , We can abolish this mechanism , Divide orders placed in one second into a period of time to process , At this time, some users may not receive the status of successful order until dozens of seconds after placing an order , But it's also better than not being able to place an order

Use message queue for traffic peak clipping , Most of the time, it's not because of lack of ability , It's a matter of economy ; For example, some business systems , The peak traffic will not exceed 10000 QPS, And usually only about a thousand QPS. In this case, we can use a normal performance server , Then add a message queue as a buffer for the peak period , It doesn't take a lot of money to deploy, it can handle tens of thousands of QPS Server for

  • 1.3 Message delivery

In the age of big data , Data is like a gold mine for many companies , Companies need to rely on data analysis , Make user portraits , Precise push , Process optimization and other operations , And the requirement of real-time processing is higher and higher . Data is constantly generated , Each analysis team , Algorithm teams rely on this data for their work , At this time, it is very important to have a persistent message queue . The data generation method only needs to write the respective data to a message queue , Data users subscribe to the data they are interested in according to their needs , The data subscribed by different data teams can be repeated or not , Mutual interference , It doesn't have to be associated with the data producer

In addition to the applications listed above , Traffic peak clipping , Message distribution and other functions , Message queuing also guarantees final consistency , Convenient for dynamic expansion and other functions

RocketMQ— More articles on getting started with message queuing

  1. RocketMq Message queuing uses

    Recently I've been looking at the message queue framework ,alibaba Of RocketMQ Stand alone support 1 More than 10000 persistent queues , Support many features , at present RocketMQ It is widely used in Alibaba Group for orders , transaction , Recharge , Flow calculation , Message push , Log streaming ,bin ...

  2. RocketMQ Deployment and use of message queue

    Please quote source for reprint :http://blog.csdn.net/loongshawn/article/details/51086876 Related articles : <RocketMQ Deployment and use of message queue > ...

  3. RabbitMQ Getting started with message queuing

    file introduction The main content :one two three four five six seven Preface middleware Message queue Asynchronous processing , Sign up and text The application of decoupling , The order interface calls the inventory deduction interface , What to do if you fail ? Traffic peak clipping , ...

  4. RabbitMQ Introduction to message queuing ( Environment configuration +Java example + Basic concepts )

    One . Message queuing usage scenarios or their benefits Message queues are usually in projects , Extract some time-consuming operations that do not need to be returned immediately , Asynchronous processing has been carried out , This asynchronous processing method greatly saves the server's request response time , Thus, the throughput of the system is improved . At the beginning of the project ...

  5. C++ message queue Getting started with message queuing

    explain : When we have multiple threads running at different speeds and we want to send messages from one thread to another in a specific order , Message queuing can be useful . The idea is , The sending thread pushes the message to the queue , The receiving thread will pop up the message at its own pace . Just send ...

  6. RabbitMQ Getting started with message queuing ( One )——RabbitMQ Installation of message queuing (Windows In the environment )

    One .RabbitMQ Introduce 1.RabbitMQ brief introduction RabbitMQ Is a message broker : It accepts and forwards messages . You can think of it as a post office : When you put the email you want to post in your mailbox , You can be sure that Mr. postman finally sent the mail to your receiver ...

  7. Apache RocketMQ Message queue deployment and visual interface installation

    One . Introduce Apache RocketMQ It's a distribution . Message middleware of queue model , With low latency . High performance and high reliability . Trillions of capacity and flexible scalability . The core component consists of four parts :Name Servers,Brokers,Pr ...

  8. RocketMQ Message queue deployment and visual interface installation

    MQ Installation and deployment Download the latest version :http://rocketmq.apache.org/release_notes Modify the configuration vi conf/broker.conf add to brokerIP1 brokerIP ...

  9. Getting started with message queuing ( Four )ActiveMQ Application example

    >> Deploy and launch ActiveMQ Go to the official website to download :http://activemq.apache.org/ I downloaded it apache-activemq-5.12.0-bin.tar.gz, Unzip to this ...

  10. Getting started with message queuing ( 3、 ... and )JMS Standards and Implementation

    >> Message middleware Message middleware is Message-oriented middleware(MOM), Message middleware uses efficient and reliable message passing mechanism for platform independent data exchange , And based on data communication to set the distributed system ...

Random recommendation

  1. solve IE 6/7 in console Object compatibility issues

    Don't talk much , Go straight to the code (function (){ // Create an empty console object , avoid JS Report errors if(!window.console) window.console = {}; var console ...

  2. About HTTP The content of the request header

    HTTP(HyperTextTransferProtocol) Hypertext transfer protocol , The current general protocol for web page transmission .HTTP The protocol takes the request / Response model , A browser or other client makes a request , The server responds . On the whole network resources ...

  3. candence Accumulation of knowledge 3

    1. PCB Board type : 1. newly build PCB:PCB design , The new type is board , Enter the name and save location , Set drawing parameters . Grid parameters . 2. establish PCB Plate frame : menu Add Next, select the appropriate tool . stay Option Options ...

  4. PHP Massive database insertion 3 Two methods and speed comparison

    The first one is , Use insert into Insert , The final display is :23:25:05 01:32:05 That is to say, flowers 2 More than an hour ! $params = array(‘value'=>'50′); set_time ...

  5. be based on ubuntu and windows Connect

    about ubuntu and centos Installing software is different about ubuntu yes   apt-get install  + Software name But for centos yes yum install + Software name therefore ubunu Remote connection ...

  6. Set up (TableViewController) General framework

    This article is about podcasting . Mr. Li Mingjie . thank

  7. [Angular 2] Keynote: Lazy Routing -- NGCONF

    So How to do lazy loading for router in Angular 2. The nomarl way to write a router in Angular 2: Yo ...

  8. Java Naming default specifications

    Study java When , The case of names is often confused , So let me summarize here java Naming specification 1.project( Project name ) There are different opinions , In lower case ,eg:arraytest 2. Package name A lowercase letter ,eg:package array ...

  9. centos7 Wrong execution chmod -R 777 / After the permission repair method

    Today, due to the authority issue zz Generally put /usr/bin and /usr/lib Two directories use chmod -R 777 I did it again , As a result, all kinds of problems appeared ,su root Report on su: The error in identifying the fault . And then online to find a tutorial, many are required in root power ...

  10. python Day 107 -- Django Basics 2

    1.Django The lifecycle of the request Routing system -> Try the function ( Access to the template + data => Rendering ) -> The string is returned to the user 2. Routing system /index/ -> A function or class .as_view() / ...