Outline ·
[ Standard ] ·
Linear+
is it true that nodejs is better for real time app
|
TSFLampard
|
Jul 12 2024, 11:10 AM, updated 2y ago
|
|
is it true that single threaded non blocking is better for app with real time function such as messaging functions?
i have been arguing with my lead to use nodejs for our messaging microservices but he die die want to use python.
i tried to make the case that single threaded non blocking event driven is more scalable for this use case because it can handle many concurrent connections without threading. this is more suitable for messaging chat app where there are a lot of concurrency.
but he said no without further elaboration.
am i right or am i wrong? and if i am right, how can i explain my point better?
|
|
|
|
|
|
flashang
|
Jul 14 2024, 08:42 PM
|
|
It depends. For case required sequential process, non blocking could cause complex design and develop. Choosing tech for project have many reason. Cost, available talents, development time / delivery timeline, team members familiar with such tech, expandable with other projects, etc ...
|
|
|
|
|
|
badai
|
Jul 14 2024, 10:54 PM
|
|
You can be right, but right is not always better. Just follow the management decision.
You will have a hard time later if you keep forcing your way, especially to your superior. Worst, if they do it your way, you will have more workload when nobody else have the skills and knowledge.
Remember, at the top, they see the whole picture. You see just what in front of you. No matter how right you are, you will never know which is better.
Eh... if i am the boss, I would do with what I am expert with right? Why spend time learning something new or risk cannot deliver it right and on time? Can I trust this one smart alec for my career?
|
|
|
|
|
|
kingkingyyk
|
Jul 15 2024, 10:46 AM
|
10k Club
|
You can use gevent in Python to achieve the same thing. If you need more concurrency just create more replicas.
|
|
|
|
|
|
silverhawk
|
Jul 16 2024, 12:25 AM
|
Eyes on Target
|
Technology choice has to be bounded by context.
What's the load like? Set up a load test, and if python handles the load within the bounds of the application, it doesn't really matter whether you use nodeJS or not.
Arguing about tech solely on its paper specs or theory, is just theorycrafting.
|
|
|
|
|
|
Lord Tiki Mick
|
Jul 31 2024, 05:30 PM
|
|
It's not true. Your system probably can accept many requests but, as the request grows, the latency will also increase. Hence you need to spawn multiple instance of your app.
Python does support mutiple threads, but due to GIL, it's basically the same as single thread.
Anyways, you can achieve async as well with python.
Nodejs is not a good choice. There are many times, there are vulnerability with the packages hosted on npm.
If you ask me, I'd just use Java 21+. 😎
|
|
|
|
|