D
D
Dmitry Putsenko2016-07-28 20:20:42
PHP
Dmitry Putsenko, 2016-07-28 20:20:42

Building large projects with Node or PHP?

Guys, I can not figure it out, help. I'm tired of looking for articles and videos. I want to create a large website, live chat, in general, multithreading will be great. On what to write the whole site? Node or PHP?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Entelis, 2016-07-28
@DIIvIIT

Chat is convenient to do on sockets, sockets are convenient to do on node.js+socket.io
Everything else imho is more convenient to do on php.
But in general +1 to Vyacheslav Lebedev , write on what you know.

I
iNeedHelp, 2016-07-28
@iNeedHelp

on Node.js, a chat can be written in no time with one of these modules:
https://www.npmjs.com/package/ws
https://www.npmjs.com/package/socket.io
Working with each of them written in great detail in Sukhov's book "Node.js: A Guide to Technology".
If you decide to write in PHP, then it might make sense to look towards ReactPHP. There are no blocking functions.

I
Ivan Koryukov, 2016-07-29
@MadridianFox

For a large site, you need the ability to scale horizontally. Those. at some point, you will not have enough power of one web server.
Therefore, large sites should be made, if not microservice, then at least such that you can raise 2-3 copies of the site and put a load balancer between them. To do this, you need to think about a few things, for example, storing sessions on a separate server (in a database or some kind of redis). What am I leading to?
Moreover, such tricks allow not only horizontally scaling a monolithic site, but also facilitate the division of the site into several parts, each of which can be written in anything. So, for example, the main part of the site can be implemented in PHP, and such highly interactive parts as chat or notifications can be implemented in nodejs. Both of these parts of the site will be able to work with the user's session without any problems, because it is not tied to a specific web server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question