Am I right or wrong on this idea? regardless of the response, because one language would be preferable to another in the implementation of a websockets server?
Am I right or wrong on this idea? regardless of the response, because one language would be preferable to another in the implementation of a websockets server?
You're partially right, or partially wrong.
NodeJS works with a single process, which executes a loop de eventos
. Each message exchanged, connection that opens, connection that closes is evento
. So, in theory, it's easier to develop websocket applications with NodeJs.
With PHP you can try doing the same by creating a long running
process that communicates with your PHP application. There are already some libraries to help you with this architecture:
However, if you want something much more like NodeJS, there is the extension PHPReact .
First comes the taste. Use the language you like, even if it does not perform as well as others.
Second comes the job market. If you create a project that turns out to be a product or a company, use a language that is easier to find people to work with.
Lastly comes cost. In the future, if your application has millions of hits and you want to save money, it's worth changing the language, even if that language is not your favorite or not very popular among developers. Netflix migrated the application that generates the Java UI to NodeJS and thus reduced server spending by 70%. NodeJs In Flames