Sunday 19 March 2017

Best practice to maintain 2 servers - PHP and NodeJs

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 future 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 to maintain Nodejs and Php server separately.



via Fernando Tan

No comments:

Post a Comment