Node.JS and PHP are both engines that power the back-end of dynamic applications, but they have very distinct differences. Here’s a comparison and why we chose to use Node.js as our tech of choice for Hi5.
WHAT IS NODE.JS?
WHAT IS PHP?
PHP is a scripting language that quickly became the industry standard back-end language of choice for developers after its initial release in 1995. A vast majority of sites on the web today run on PHP, due in large part to its popularity as the technology of choice for content management systems like WordPress, Drupal, and Joomla. As well as a number of modern frameworks such as Laravel, Symfony, and CakePHP that have taken full advantage of this languages power. Running on a multi threaded I/O blocking execution.
WHEN SHOULD YOU USE NODE.JS OR PHP?
You should consider PHP if your project involves:
- Software stacks like the LAMP stack (Linux, Apache, MySQL, PHP)
- Content management systems like Wordpress
- Servers like MySQL, SQL, MariaDB, Oracle, Sybase, and Postgresql etc.
You should consider Node.js if your project involves:
- Software stacks like the MEAN stack (MongoDB, Express.js, AngularJS, Node.js)
- Dynamic single page applications (SPAs)
- Front-end technologies like jQuery, AngularJS, Backbone.js, Ember.js, ReactJS etc.
- Server-side technologies like Node.js, MongoDB, Express.js, etc.
Note that neither of lists above are extensive, or dutifully explain the extent to which you can use these two technologies. The choice to use Node.js as our back end at Hi5 came down to these simple points.
- Allowed us to write a clean single language API to connect all 3 of our platforms (Web, Android, iOS) whilst taking advantage of its beautifully clean JSON handling methods
- Easier to secure with standard SHA256 encryption when combined with MongoDB.
This isn’t to say Node.js is better than PHP, it just suits our needs.