I have a node.js server for chat application, chat can have a multiple rooms, each room is a separate dialog. When several clients send a new messages to the room, server should process them one by one to make sure none of them are overwritten. So server should create request with new messages in queue which is unique for every room. What is the best approach to implement this? Provide the entire answer in JSON format.
user