If you had to write a message queue, how architecture design ah?

Copyright: ~ reproduced please marked, thank you - if infringement please private letter to me, I will immediately delete ~ https://blog.csdn.net/baidu_26954625/article/details/90648295

本系列内容转载自git项目advancejava

Face questions analysis

In fact, to answer such questions, plainly, do not ask you seen the source code of that technology, at least you should probably know the basic principles of the technology, the core component, constitute the basic framework, and then refer to some of the open source technology to a system designed say something like thinking.

For example, the message queue system, from our point of view about the following:
First, this was mq scalability to support it, is the rapid expansion when needed, you can increase the throughput and capacity
design a distributed system chant, referring to look kafka design, broker -> topic -> partition , each partition to put a machine to save part of the data. If the resource is not enough now, simple ah, to the topic increase partition, then do data migration, increase the machine, you can not store more data, provide higher throughput up?

Second, you have to think about this mq data to disk do not fall , right? That certainly want to, do not drop the disk in order to ensure the process hung up on the lost data. That fall off the disk when how ah? Sequential write, so there is no disk random read and write addressing overhead of disk read and write sequential performance is very high, which is kafka ideas.

Second, you think about your availability mq, ah ? This thing, before the specific reference to the availability of high availability protection mechanisms that explain the link of kafka. Multiple copy -> leader & follower -> broker linked to the re-elected leader to external services.

Can support data 0 loss ah ? Yes, we said before that reference kafka zero data loss solution.

Guess you like

Origin blog.csdn.net/baidu_26954625/article/details/90648295