Why Node.js?

Prashant Sudeep
3 min readJul 16, 2019

--

When we started Medimojo, everything was on PHP(core PHP, no framework), because that’s what I knew and was confident enough to build anything and everything.

And anyone who is trying to build something should go for the language s/he knows the best and confident to make it work and fix bugs quickly. Making things work is most important, language is just a medium. I wrote the first version of website and the platform between August 2015 till October 2015 while I was still working with Tyroo. I used to do this on weekends(as side project), as I had no plan to join Medimojo(at that time).

Now, what led to me moving our application from PHP to Node.js?
Human behaviour works on perception and beliefs(socially accepted). We were often asked about our Tech stack used and saying PHP raised lot of questions about scalability, security, performance and limitations in the longer run. Honestly, I had no clue of all that as we had just started and hardly had any traffic on the platform. But since it is a believed to do whatever everyone is doing and accepted in Startups and large companies, I decided to figure out what is popular & acceptable.

Our existing application had multiple processes running in parallel and we needed a language to do asynchronous tasks. I read about Uber’s tech stack which had re-written their entire dispatch system in Node.js and was performing much better than the earlier one. We kept analysing multiple companies which were scaling faster with large data sets . I came to a conclusion that Paypal, Netflix and Paytm were using Node.js, which seemed like the language when fast scaling & performance is needed.

I looked at different popular frameworks which was being used at that time and then decided to go ahead with Sail JS. It was lightweight and very fast. Node.js is eventually JavaScript as an underlying language running on server side and it’s easy to find developers for JavaScript and with similar skill sets we can write both backend and frontend in parallel. Quicker on boarding process for new developers.

How I learned Node.js?
I was seeing my friend Dwivedi using Node.js at Tyroo(which was using PHP at the time) and helping transition from PHP to Node.js and it was scaling really well. I asked Dwivedi to help with Node.js and he started teaching Node.js to everyone in the engineering team at Tyroo post office 6 pm(for a week). This helped me get through the basics of Node, routing, DB connections and callbacks.

Even though you get through the basics and build a small application, it is never a right choice to move a running website/platform unless you are confident enough to make it work end to end.

I wasn’t confident about it and was not in a position to break a working stuff(especially in early days of a Startup). But that’s the time you can actually break and make things work(I can say this in hindsight, but I was scared of failing & breaking stuffs at that time).

I asked my friend Sagu about it, he too was using Node.js at a company he working at that time and helped me understanding the intricacies of the language and infrastructure setup related things.

It was around April 2016 when our first Developer Rajesh has joined and he had started helping me in the existing developments. This made me focus on writing few APIs in Node.js. I wrote some of the APIs which were to be used in the existing platform and started testing it on live environment for a week and it worked fine. This gave me confidence and I wrote the entire backend(of existing application) in Node.js in 2 days.

Both me and Rajesh tested started testing the exiting application with new APIs written in Node.js for around a week and deployed it on production in September 2016.

We did a POC for one of the products which was live in the field by moving traffic on the newly backend and it scaled rapidly and decreased out servers and were able to run multiple APIs on same server without affecting the performance. And since then we have never looked back and all our existing applications & APIs are written in Node.js.

We currently process around ~25 million patients data across multiple providers in our application and it scales smoothly.

--

--