Sockets, when to use socket actions?

Thanks Teodor I’ve been looking at all your threads for some time now :wink:

Please advice:

  1. I have 2 tables: schools and schools_notifications
    image
  2. I want to send a notification (news message) within a specific school, so I insert a new record in schools_notifications
  3. I want everyone on the page of that specific school to get the red circle on their notifications icon image once I add the notification

Do I use the same logic from this thread WebSockets - Realtime Messaging or from this thread: Realtime Data Update with NodeJS and WebSockets

(the last thread does what I want but that was before the full integration of sockets, I don’t need to send a message to ALL clients. Only the clients that are on a certain school, so on a school.mywebsite.com subdomain.)

1 Like