Node.js vs Django server downtimes

Hello everyone
I’ve worked as a Node.js developer for a while and I’ve heard about Django server’s reliability and almost zero downtimes.
I understand that we have tools to restart processes in case of crash and failure (e.g. PM2 for Node.js and Gunicorn for Django).

Here is my concern: I work as a freelancer and I’m worried about getting a call from my employer about server downtime due to a server crash now and then.

Was it a mistake to learn Django just for server reliability on crashes?

Which server is more reliable on production and prone to crashes, Django alongside Gunicorn vs Node.js alongside PM2?

Hello there, welcome to the community.

Well, learning is never a mistake.

That’s a tricky question to respond, because there are several things that can make an application crash, and that depends a lot on how you setup your deployment environment.
For example, if you store your media files on your local machine, and “just forget about it” you can end up with your disk full and suddenly your app crashes because it doesn’t have any more space on disk. This can happen both on nodejs and django or any other tool.

The main point for me is that if i’m doing freelance i want something that makes me feel really productive and deliver quality software to my customer. For me django is the one that I feel more comfortable, and so i use it more often.

All of this aside, you’re more likely to get a pro-django answer here, based on where you placed your question.

1 Like

Thanks for your reply
So essentially Django servers can crash and not auto restart, even using tools like Gunicorn which is a WSGI web server that spawns up multiple worker processes and restart them when they crash.

So I have to focus on dealing with scenarios that may cause server crashes no matter what language and framework I’m using.

Yes, essentially if you have a problem on your code that causes a “crash” (a 500 error) or other sort of problem like a timeout, then gunicorn will auto-restart the worker that has crashed, meaning that you’ll only see a problem on one request, affecting probably one user. And surely if you don’t fix the problem it will happen again.

When you say “server” for me that is the machine that is hosting your application, and when that crashes then no framework will be able to recover. But when the server is started again, some cloud platforms do this automatically, you can setup your application start on the server initialization, like systemd.

1 Like

By the server I mean the software that runs the Django project, like Gunicorn.
I’m aware that when the actual host machine crashes, as a developer nothing else can we do to prevent that from happening.
Thanks again.