PHP Vs Django vs NodeJS: My Choice of backend technology stack

Sanghmitra Rathore
5 min readSep 20, 2021

--

PHP vs NodeJS vs Django

While it’s amazing to have so many choices, it also makes it difficult to know what the best technology is for your goals. With so many top options to choose, you might fall into analysis paralysis trying to decide between all the options.
So, let’s fix that by narrowing it down! by sharing my experience in corporate from the past few years. Before going ahead I want to give my small intro to you to make you feel that you are reading a practical experience.

My Introduction (You can skip this to continue focusing on tech only)
Hi, I am Sanghmitra Rathore a Software Engineer currently working at the world’s top EdTech company. I do not attach myself with specific technology but still I have good practice in MERN stack and Django framework. but I have gotten into the part of a couple of projects which was developing in python and C# also.

Experience with Django
When I joined my first project which was based on Django here we were using Django and backend and React at frontend, what I liked about Django that It has well structured architecture which insist you to follow some good practice of file system architecture because on project setup it provides you all empty files and folders. I feel this is a good start for a fresher to understand the importance of project structure, security and MVT architecture, And here I personally love 😍settings.py file.
What is the challenging side of it? It needs extra effort in the starting to understand the concept.
Some of the world’s leading app’s use Django only, for ex. Instagram, shopify etc.
what is hidden advantage of Django? I think its Python. because python is popular in the AI/ML segment so it is easy to integrate that code with Django and then BOOOOOOOM…..
So if your project requirement is related to AI/ML , Image processing or any server side analysis? I will suggest Django here, though the same thing may be possible in other options but ease of job done, available help and tech community matters.

Experience with NodeJS
After successfully finishing my first project I joined another team. Let’s understand the project requirement here. It was completely developed in the PHP and due to some new requirement was coming related to project enhancement and optimization, then management and project architects started brainstorming on the right tech stack for version 2.0 of that old project. and they concluded that they were dropping PHP Laravel and now use NodeJS as backend and React as client side technology with MySQL and MongoDB together. How do they end up with these options ? let me put some facts here

Performance
Clients and developers are concerned about performance in software development. When talking about performance, speed is a common association. The response time of an application is often an indication of code execution speed. To compare, Python Django is significantly slower than NodeJS. Despite the usage of frameworks to make applications faster and optimal, Node.js significantly performs faster than Python.
A performance comparison of Request per second vs amount of response per second is shown here

Performance comparison of Request per second vs amount of response per second

Scalability
Scalability refers to the capacity of a system to handle a scaling work. Multithreading is the best technique for an application to be scalable. Python supports multiprocessing. It uses Global Interpreter Lock (GIL) to understand multiple tasks to perform concurrently, thus it only runs a single thread at a time. On the other hand, Node.js is a pure JavaScript implementation, and it is used for asynchronous programming. This means that scalability is possible in simple web applications.

Trend

According to a stackoverflow survey , Javascript is the top choice among the tech community for seven consecutive years.

5 years of comparison in NodeJs, Python and Laravel
On Udemy most popular courses are of NodeJS followed by Python.

Udemy’s most popular courses are NodeJS followed by Python(Screenshot of Sep 2021).
so the Idea here is, As large community size> sufficient help> huge tech adoptions> good amount of project > good amount of Jobs
This chain is interlinked.

Simplicity
NodeJs (Talking about ExpressJs) gives freedom to the developer to define his own project structure and handle security on his own. Sometimes it’s good to have freedom but it’s risky at the same time too , in case of less experienced developers, who may leave loopholes.
Another fact is, since Javascript is one of the most popular programming languages and it provides best client side libraries like React, Angular and VueJS, then it’s a good idea to use the same language at backend also. I personally like this combination, on the team led point of view, because there is more chances that if a developer knows frontend framework then he/she comfortable with NodeJS framework also or vise-versa. which saves time of development, reduces interdependency and helps to assign end to end ownership of a module. Hence overall development speed boosts.

Some of the big companies which use the NodeJS are Netflix, reddit, twitter etc. I have found that normally OTT content based companies use NodeJS often.

What is my experience with PHP ?

Well I don’t consider myself the right person to give my opinion on this because I don’t work in PHP framework. I heard that the Laravel framework is doing good and is top choice among the PHP community. but still its code looks clumsy and not well structured. Some of my friends who work in PHP are showing interest in NodeJS. So overall I can see PHP does not attract me as much as Python and NodeJS does.

My Ranking of Technology

  1. NodeJS (ExpressJS, NextJS)
  2. Python (Django)
  3. PHP (Laravel)

Thanks For giving your time.

Enjoy this post? Please buy me a coffee. Thank you!

--

--

Sanghmitra Rathore

AWS, Webapp, IOS, Android || Nexts,Reactjs,NodeJs, MongoDb