We have a Symfony backend server for our Android and iOS application. Recently we need to extend our application by supporting real time interaction such as chatting, and we decided to use NodeJs with SocketIo to support it.
Currently our design is to let NodeJs acts as man in the middle. Nodejs would just receive request and forward to PHP for further processing. In PHP side, it will store a list of active socket id with associated users. PHP will send the push notification to NodeJs and NodeJs will forward the message accordingly to the user's mobile.
It means all of our logic are placed inside PHP only. It saves our effort in certain way e.g. jwt authentication only done in PHP and NodeJs would not directly communicate with database
I am curious about the best practice or industry standard on how to maintain Nodejs and Php server separately.