Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is Replica in KAFKA

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is Replica in KAFKA". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is Replica in KAFKA".

Can you tell me about the master-slave design of Replica? ]

Redundancy, which can be understood as an action, is to copy more than one copy of the data.

The copied data is called replica, which is the real meaning of Replica, so there must be the problem of data synchronization among multiple replicas:

That is, between different copies, which copy of the data prevails, how to keep the data consistent these two main issues.

Therefore, there is a master-slave design between replicas, and the copy responsible for providing read and write is leader, while the other copies are called follower,follower replicas. You just need to pull data from the leader copy all the time, and normally you don't need to provide read and write.

It looks like this:

Can you tell me what problem Replica solved? ]

First of all, we have to understand that the data copies of a Partition are distributed on different broker, that is, on different machines, so it is obvious that Replica is designed to solve the single point problem.

Let's reconsider what single point problems there will be.

1. When we produce a message, if the data is returned after only one broker is written, is it possible that the message I just wrote will be lost once that broker goes down or the machine goes down?

2. Our production / consumption is only for leader-replica, so once the broker where the leader is located is down, or the machine is down, the production and consumption cannot be carried out?

These are the two main problems. After introducing the design of the copy, it is very simple to solve these two problems:

1. Since there are multiple replicas, we can set all replicas to be written before the message is written successfully; then the data will be distributed to multiple nodes, thus avoiding the single point problem. This is the high reliability of the message mentioned earlier.

2. Since there are multiple replicas and the data between the replicas is synchronized all the time, once there is a problem with the node where the leader resides, we can switch between master and slave and let a follower become a new leader to continue to provide read and write, thus avoiding the unavailability of the whole service. This is the high availability of the implementation service mentioned earlier.

Thank you for your reading, the above is the content of "what is Replica in KAFKA". After the study of this article, I believe you have a deeper understanding of what the Replica in KAFKA is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report