Why I choose Go over Node
Ahmed Farooq

Ahmed Farooq @ahmedfarooqdev

About: Tech Geek

Location:
Pakistan
Joined:
Jun 11, 2024

Why I choose Go over Node

Publish Date: Jun 6
5 2

As a node js developer it's really - really hard for me to admit that node is not built for complex multithreading applications. Somethings which would be as easy as hello world in some other language or runtime - it would be near impossible to implement in node js espically due to it's single threaded nature. Go on the other hand comes with built in support for multithreading.

I had been tackling an issue where I needed to synchronize my database with a CRM database which had strict limit on how many API requests I could make per 5 secs. I tried everything from shifting framework (Node to Nest), tried using event driven architecture with REDIS as transport, and tried using BullMQ. But nothing worked; I needed my application to run 24/7 and keep data in sync - node just couldn't do it. It lacks alot in this domain due to it's internal acrhecture.

Sample architeture for api polling

Go on other hand had shined here - it came with built in support for background jobs running on multiple threads. I could make 100s to 1000s of background jobs using go routines on same machine where I could barely run 3 or 4 in node js. Go allowed me to run the application 24/7 without any downtime - yes I mean any. Not once was heap memory full or some other internal issue.

But even go had it's downside. Not a lot of community support espically in niched areas. I had to build a lot of stuff which is easy to implement in node js by installing third party libraries.

if anyone has worked or is working on API polling database's, or similar task - I would love to connect with you

Comments 2 total

Add comment