Interview series of seven write a message queue

You probably know at least the basic principles of the technology, the core component, constitute the basic framework, and then refer to some of the open source technology to designed a system of thought say something like

 

For example, the message queue system, we come from the following point of view it

 

(1) First of all the mq have to support scalability it is the rapid expansion when needed, you can increase the throughput and capacity, then how do? Design of a distributed system chant, referring to what the design kafka, 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?

 

(2) Secondly, you have to think about this mq data to disk do not fall, right? It will certainly be up, off the disk, in order to ensure the process do not 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.

 

(3) Second, you think about your availability mq, ah? This thing, with particular reference to the availability of high availability protection mechanism before we explain that part of the kafka. Multiple copy -> leader & follower -> broker linked to the re-elected leader to external services.

 

(4) can support data 0 loss ah? Before you can say is, we refer to the kafka zero data loss programs

 

In fact, a mq certainly very complex, the interviewer ask you this question, in fact, is an open question, he is to see you there from an architectural point of view the overall concept and design and thinking ability. This problem can be washed off really large number of people, because most people usually do not think about these things.

Guess you like

Origin www.cnblogs.com/xiufengchen/p/11258891.html