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's the difference between kafka and redis?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is to share with you about the difference between kafka and redis. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

The difference between kafka and redis:

1. Redis message push (based on distributed pub/sub) is mostly used for real-time message push, which is not reliable.

Other mq and kafka are guaranteed to be reliable but have some latency (non-real-time systems have no guaranteed latency). Redis-pub/sub is emptied when power is off, and using redis-list as a message push is persistent, but it is too retarded and not completely reliable to lose.

2. Redis publish and subscribe does not support grouping except for different topic. For example, when a thing is published in kafka, multiple subscribers can be grouped, and only one subscriber in the same group will receive the message, which can be used as a load balancer.

For example, the message published in kafka: topic = "post" data= "article 1", there are a hundred servers behind, each server is a subscriber, all subscribe to this topic, but they may be divided into three groups, 50 in group A, used to actually publish articles, and all subscriber in group A subscribe to this topic.

Because in the same group, this message (topic= "post", data= "article 1") will only be received by one currently idle machine in group A. While 25 servers in group B are used for statistics and 25 servers in group C are used for archiving backups, only one server in each group will receive.

Different groups are used to decide how many points each message should be copied out, and which subscribers in the same group are busy and which subscribers are free to decide which server the message will be assigned to process, producer-consumer model.

Redis does not have such a mechanism at all, and these two points are the biggest difference.

Thank you for reading! On the difference between kafka and redis to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

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

Database

Wechat

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

12
Report