Middleware (2) message queue and middleware Message Queue

Source: Internet
Author: User

Middleware (2) message queue and middleware Message Queue

Message Queue is also an important middleware for building large-scale website architectures.

Message Queue

All those who have used message queues know that the two most common scenarios of message queues are:

1. Decoupling is generally used for message communication between applications when a large website is split for business.

2. asynchronous: for operations that do not require synchronous execution and can be executed later, asynchronous operations can be used, such as sending emails and text messages. In fact, using message queues for asynchronous processing can also improve performance, because the processing speed of the Message Queue Server is much higher than that of the database server.

 

The most common message queue components are RabbitMQ and Kafka. The following describes the differences between them.

RabbitMQ vs Kafka

Basic Information

Take a look at the following table:

The following conclusions can be drawn: Kafka is more popular and the version of rabbitMQ is faster.

 

Architecture Model

RabbitMQ:

 

Kafka:

As you can see, both RabbitMQ and Kafka have message producers and consumers, but the two are different in broker processing. RabbitMQ has the concept of exchange switch, but Kafka does not. 

 

Performance Comparison

There is no comparability because the application scenarios are different. Test Conditions: normal pc, dual-core cpuKafka: 100 k msg/sRabbitMQ: 40 k msg/s

Application scenarios

When it comes to application scenarios, let's look at the differences between the two in application scenarios:

RabbitMQ: built in to support high concurrency (erLang language features), supports higher reliability of transactions and message validation, and is generally used for inter-Application Communication.

Kafka: stream data, big data processing, does not support transactions and message validation. It is generally used in log collection because occasional message loss is allowed.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.