当前位置:网站首页>About pushing user messages

About pushing user messages

2022-06-09 06:45:00 Tangbohu points mosquito repellent incense DW

Come across an interview question : You need to push an activity message to all users , such as 618 Great promotion , Each user receives the message and displays it , Generally, the bell in the upper right corner displays unread messages .

In this scenario, you usually choose to use kafka To push messages , If there are tens of millions of users , Then push a message for each user , Or a message , Bind a relational table for each user , After user reading , Message prompt message , In this case , Pushing a message will generate tens of millions of data , Is there a better way .

You can use kafka Of offset thought , Each user saves one offset, adopt offset To consume and read messages , such kafka There is only one message , But every user can read , And each user can use their own offset To determine whether it has been consumed .

原网站

版权声明
本文为[Tangbohu points mosquito repellent incense DW]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090639459418.html