Let's say I'm making a chat, is it possible to sent messages to specific users and particularly groups of users? Can I hook up ID's to clients that have been logged on and groups that have been started, so I can sent messages to the server using these ID's and the server just sends these messages to the correct people? The chat app would look much like a chat from an MMO game where you can receive broadcast (from entire network), room, private, group and party messages in the same window.
Also I have a database behind this, is it possible I can use this for the above? Like using the same user ID's as in the database? Likewise I'm storing groups with an ID.
You can create rooms or even private chats using web sockets, there are lots of examples out there. I have only used Socket.IO and they are finally 1.0 production ready. Check their docs: http://socket.io/docs/rooms-and-namespaces/
// Join
io.on('connection', function(socket){
socket.join('some room');
});
// Emit
io.to('some room').emit('some event'):