good and bad parts. If so, how do we make the right choice? It’s possible if we leverage our knowledge of both environment’s architectures and ecosystems.
In particular, asynchronous and event-based architecture of Node.js makes it a great fit for RTA (Real-Time Applications) such as instant messaging and collaborative apps (drawing and video conferencing) in which many requests are happening concurrently and where data is frequently shuffled back and forth from the server to the client.
Node.js support of server-side events and WebSockets makes it easy to implement pub-sub (publish-subscribe) architectures used in RTAs and quickly update the view on the client side. The same features make Node.js suitable for applications that process data from IoT (Internet of Things) and Single Page Applications (SPAs) that involve highly flexible, dynamic and heavy client-side functionality.
With Node.js, it’s also easier to implement web services in which the server-side functions as a REST API that provides the connection between the client and a database and where the speed of CRUD operations and asynchronous processing is of great importance.
In its turn, PHP is a good choice for a standardised solution such as a blog, news site, landing page or web portal. With such CMS (Content Management System) as WordPress written in PHP, you can create stable and customisable blogs without too much coding. If you need more customisation, WordPress provides a well-documented API to change application’s structure, presentation, plugins, etc.
As a bonus, WordPress community has created thousands of customisable themes that open infinite opportunities for web designers. Whenever time is a consideration, you can develop almost any application ranging from a blog to an e-commerce site with CMS and other tools written in PHP. PHP is also a better choice if hosting support is the issue. If your client wants a shared hosting service instead of a full-fledged virtual cloud instance, PHP provides more flexibility in integration and deployment.
So, when choosing between Node.js and PHP, you should definitely consider what type of application you are going to build, what are the hosting requirements of your client, and what is the speed of development. If your client is looking for a standardised solution with an extensive hosting support, you should consider using PHP. On the other hand, Node.js is a better option for RTAs (Real-time Applications) such as chats, collaboration apps and SPAs (Single-page Applications).
from: https://www.netguru.com/blog/nodejs-vs-php
What are good parts of PHP?
Обсуждают сегодня