Scalability of Channels (Pub/Sub)

已查看 35 次
跳至第一个未读帖子

Prasanga Siripala

未读,
2016年6月23日 23:27:582016/6/23
收件人 Redis DB

I'm building a real-time text based chat program where people can chat with ONLY 1 other person.
Each person can chat with 1 other person, but the aim is they can chat with Many people at once. (i.e. MANY one to one chats with different people). The aim is to have it scaleable, not necessarily to snapchat's level, but enough for 1 City.

I'm just wondering what is more scaleable:

  • Having 1 channel for the entire application and filtering who the message is for and who sent the message based on the data encoded in the message

OR

  • Having 1 channel for each person and all the different people sending messages to that person send their messages through that channel with data encoding who sent the message

OR

  • Have an individual channel for EACH Chat between 2 people.

OR

  • For Option 1 (1 channel for entire app), perhaps an intermediate solution of having 1 channel per city.

I'm wondering what approach is best for Go and Redis. If there is no clear cut answer, what the conditions/criteria are for making the decision.

Shahar Mor

未读,
2016年6月26日 05:50:222016/6/26
收件人 Redis DB
As it is today, Redis Pubsub is probably not the way you want to go. Read here for more info: https://github.com/antirez/redis/issues/2672
Regardless of this, options 2 will probably be the best
回复全部
回复作者
转发
0 个新帖子