What is Distributed Messaging Middleware?

For distributed message middleware, we must first understand two basic concepts, that is, what is a distributed system and what is middleware.

Distributed Systems

“A distributed system is one in which components located at networked computers communicate and coordinate their actions only by passing messasges.”——《Distributed Systems Concepts and Design》

From the above explanation, two characteristics of distributed systems can be obtained:

  1. Components are distributed on network computers
  2. Coordinate actions between components through messages
  • middleware

Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue". Middleware makes it easier for software developers to implement communication and input/output, so they can focus on the specific purpose of their application.——维基百科

Middleware is described as providing applications with services other than those provided by the operating system, simplifying application communication, input and output development, and allowing them to focus on their own business logic.

The explanation of middleware on Wikipedia feels a bit confusing. In fact, middleware can be understood from the perspective of "space", that is, middleware is a component in the "middle layer", which is between the upper-layer application and the underlying service. Bridge (for example, the upper layer of DB middleware is the application program, and the bottom layer is the DB service), and it is also the bridge between applications (such as distributed service components).

  • Distributed Messaging Middleware

“Message-oriented middleware (MOM) is software or hardware infrastructure supporting sending and receiving messages between distributed systems.”——维基百科

Wikipedia defines messaging middleware as hardware or software infrastructure (and certainly software for the scope of our discussion here) that supports sending and receiving messages in a distributed system.

Then the distributed message middleware actually means that the message middleware itself is also a distributed system.

What can message middleware do?

Any middleware must solve a problem in a specific field, and message middleware solves the problem of message passing between distributed systems. Message passing is a problem that distributed systems must face.

Assuming an e-commerce transaction scenario, the user calls the inventory system to reduce inventory after placing an order, and then needs to call the logistics system for delivery. If the transaction, inventory, and logistics belong to one system, then it is an interface call. However, with the development of the system, each module becomes larger and larger, and the business logic becomes more and more complex, so it must be service-oriented and business split. At this time, it is necessary to consider how these systems interact. The first reaction is RPC (Remote Procedure Call). As the system continues to develop, a transaction may need to call dozens of interfaces to execute the business, such as risk control systems, SMS services, and so on. At this time, the message middleware is needed to solve the problem.

The author believes that the difference between RPC and message middleware scenarios largely lies in "dependency" and "quantity". For example, the SMS notification service is not necessary for the transaction process, does not affect the ordering process, and is not strongly dependent, so the transaction system should not rely on the SMS service. For example, some data analysis programs may need to obtain the total sales volume of a day, which only requires the sales center to provide an interface to call when needed.

After the message middleware appears, the transaction scenario may be to call the inventory center and other strongly dependent systems to execute the business, and then publish a message (this message is stored in the message middleware). For example, the SMS notification service, the data statistics service, etc. all rely on the message middleware to consume this message to complete their own business logic.

From the above scenarios, it can be seen that the message middleware is actually decoupling the system, and at the same time brings benefits such as asynchrony.

简单概括一下消息中间件的应用场景大致如下:

  • 业务解耦:交易系统不需要知道短信通知服务的存在,只需要发布消息
  • 削峰填谷:比如上游系统的吞吐能力高于下游系统,在流量洪峰时可能会冲垮下游系统,消息中间件可以在峰值时堆积消息,而在峰值过去后下游系统慢慢消费消息解决流量洪峰的问题
  • 事件驱动:系统与系统之间可以通过消息传递的形式驱动业务,以流式的模型处理

分布式消息中间件长什么样?

一个抽象的对分布式消息中间件的认知大概是这样:

  • 有一个SDK,提供给业务系统发送、消费消息的接口
  • 有一批Server节点用于接受和存储消息,并在合适的时候发送给下游的系统进行消费

关于分布式消息中间件详细内容:

【分布式架构】分布式消息中间件MQ开发教程

(阿里云消息队列MQ(Message Queue)是企业级互联网架构的核心产品,服务于整个阿里巴巴集团已超过8年,经过阿里巴巴交易核心链路反复打磨与历年双十一严苛考验,是一个真正具备低延迟、高并发、高可用、高可靠,可支撑万亿级数据洪峰的分布式消息中间件。)

内容介绍:

课时1:MQ 快速入门 02:19

课时2:MQ 介绍 15:02

课时3:MQ 资源报表使用指南 01:00

课时4:MQ 消息查询 02:16

更多精品课程:

7天玩转云服务器

云数据库Redis版使用教程

玩转云存储对象存储OSS使用入门

阿里云CDN使用教程

负载均衡入门与产品使用指南

阿里云大学官网(阿里云大学 - 官方网站,云生态下的创新人才工场

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324412404&siteId=291194637