I aim to make an chat app with an option for private and group chats. I'm more used to using Ratchet and WebSockets with PHP, rather than using node.js, being that people told me that would be the best.

Though I've only seen examples of WebSockets on the context of global chats.

My approach is to use the WebSocket id and store it in the Database, for when people request to chat with a certain person or with people from a certain group, I would give the server those id's and it would send to only those people

Would that be the right way? Is there any better approach to this?