Is it bad to use dynamic topic for all my online users


#1

I am confused about the usage of dynamic topics. In my site, I need to send lots of notification to each users. The site is a social network site.

In order to send notification to each individual user, I am using their unique ids with channel name to make it dynamic.

const intro = ws.subscribe('chat:5') this way, when user 5 needs to receive any notification, I send using it. Is it bad practise or there are any other good of way doing it?

Many thanks.


#2

Hey @hkmsadek! :wave:

If you secure this channel there’s nothing wrong about doing that.


#3

Thank you so much. I was worried mainly for if there will be any huge memory leak or not since there can be a lot of dynamic channel.

One question, could you please try to explain some security things about sockets?

Thanks a lot.


#4

Just google “websocket security” or something like that and you’ll find tons of answers.