I've read a lot about websockets and already implemented them within my system. This question is about how to use them properly. I want to implement a notification and a chat system the right way.
For notifications, I have the channel "notifications/channel" and for chats, I have the channel "chats/channel".
Aren't these two channels too "global" ? Let's say when the site has 1.000.000 users, this would mean all these users would be in these two channels. When one notification gets sent to another specific user, this would mean, that the message gets sent through a channel, where 1.000.000 users subscribed to.
Same with chat messages. Let's say a user wants to chat with another user. Each message would pass the channel where all users subscribed to and in the end, only the target user would receive the message due to a passed receiver_id.
How to handle properly notification channels and "private" chat channels?
Would it be more performant and secure to create for each User a "sub channel " (Group chats And notifications, E.G "notifications/channel/user1"), or just let all users in one big channel?