My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Why do we write Node.js microservices instead of other strong-type language such as Java/PHP/Python?

Hieu Lam's photo
Hieu Lam
·Sep 16, 2018

This question has arise to me for a while now. I am working in a company apply microservices architecture. They have a big monolith written in PHP but recently break down that into smaller microservices written in nodejs/es6.

I know Node.js is non-blocking-io and can handle lots of requests compared to blocking io couterpart. And nodejs and npm echo system provides lot of awesome dependency that we can make use of.

But the problem is that the Node.js backend code is not very easy to read if you just use Promise. I usually need to use async/await to make to code more imperative.

So my question is why don't we just write nodejs as controller to handle incomming request and then forward that request to micro-services backend written in Java/Python/PHP. With that approach we still leverage the nio nature of nodejs and still can leverage the clear code style of other programming language.

To me, We can combine the best of both worlds.

What is your thought ?