I’m thinking of integrating a chat inside an already written and working php application.
As I have to choose the chat implementation yet I’ll show you some consideration:
- PHP is not good for Comet application. A php comet server for managing chat would not scale well, so it wouldn’t be my first choice.
- Node.js + Socket I/O, can eventually be a good option for the chat engine.
- AMQP (RabbitMQ?) can be another possibly good solution, not exclusive with node.js as they can integrate pretty well.
The main problem is: how can I avoid code and business logic duplication? There are some aspects I’d like to point out:
- The application manages users in a RBAC fashion. Users should be able to chat with other users depending on their role (and some other business logics). It would be hard (and bad practice imo) to duplicate that logic.
- If I use two different server processes (as I think) for IM and application, how can I manage http session?
In short: IM would be tightly coupled with business logic, so I really need to avoid code/logic duplication, but at the same time I don’t want a PHP chat engine.
Thank you in advance.
I am using something in my php application called
PusherHere is the Link for Pusher