I am working on realtime app (chat) & using angular and my backend is php(codeigniter restapi) for database in mongodb I hear somewhere that socket.io is best library for socket (use for real time) , and i see socket.io is mostly use with node.js , so may i need basic knowledge of node or any other feasible way to work with socket.io , angular and php
You have 3 ways:
It depends how large is your API. But in my opinion for MongoDb and sockets node.js will be better than PHP.Why? MongoDB using JSON format and NodeJS is javascript server so it is better to handle JSON. Also NodeJS have non-blocking IO so it will be faster for socket than PHP. You can read more Here. NodeJS is very simple to learn.
You don't need to start new node.js server if you already have PHP. You can use a library similar to socket.io. Lets check: Elephant IO
I think you don't need to use all data from API for socket. So you can create node server only for socket calls and PHP server for API calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With