I once would say Node.js but now I feel that Go has more potential for several reasons:
There are definitely downsides to both. Go does have a learning curve if you are coming from the JS side but the same goes for C and C++ developers going to the Node side. I think it really boils down to your apps needs. Use the right language and tools for the job and don't simply pigeonhole yourself into one language.
First few versions I would build quickly in node. If the project/service grows to sizes where significant amount of hardware can be reduced by golang then it should be considered.
This really depends on the scale of your micro service and the requirements. Go is great at handling async/concurrency based work and scaling well. Node is probably more suitable if you're just writing a small API to support internal work. I imagine more people can develop for Node than Go so that's something to think about in terms of ongoing development and support.
When we need fast development and an simple and elegant way to create micro services, Node.js os a good option. Node.js not solve all The problems, but you can integrate and manage all your services just using Node.js. Go also a good option too lime perhaps Elixir or Rust too. If you're not confident with Node.js just because Callback Hells, you really need go dive in JavaScript and learn a Little more than the basics to avoid callback hells.
I also loves golang concurrency design, but node.js is pretty handy to write microservices these days. You probably will find some messy legacy code only with callbacks/promise hell etc.., but you also find shit code in any language, so it's not node.js fault. It's pretty straightforward to write elegant async/concurrent/parallel code with node.js using generators and async/await
post('api/v1/orders', async (ctx) => {
try {
// for me one app is fast when handling IO bound, like this
await Promise.all([
Order.create(ctx.body),
Invoice.update(ctx.body),
Tracking.updateWithOrder(ctx.body),
Event.traceOk(ctx.body)
])
ctx.body = {created: true}
}
catch (err) {
ctx.throw(422, err)
await Event.traceErr(ctx.body)
}
})
EDIT March 1, 2020: A lot has changed since then... Go it is!
JavaScript. Simple. If I was having this conversation with Marty McFly, I would tell him you can develop a full-stack with JS only. I think a lot of developers tend to take this awesomeness for granted. Just imagine Marty's face when I tell him...
I personally prefer Go over Node.js. I find writing services on Node a mess of callbacks and promises. Go is just as quick to develop and the threading model, amongst other things, is just awesome. Purely on a personal level, I think that Javascript is a language out of place on a server.
If I can pick only Go or Node.js then I pick Node.js. It's so rapidly developing, fast changing, and it offers endless possibilities solving many but not all problems.
No go (yet), but we're running both NodeJs (build with Typescript) and Scala/Akka
Drew Ogryzek
Well, start with one, and ask the question, "Are there any advantages/disadvantages to choosing the other?"
Personally, I find the mindset of the Go community to be wary of pulling in unnecessary dependencies, and favor writing it yourself, of perhaps copy/pasting some methods from a popular library, rather than depending on it. I also find more experienced developers preferring Go.
Node, on the other hand, seems to prefer pulling in whatever dependency has 1 method the developer would like to use, without any thought to how that will affect other developers, and/or the overall project.
All the above is purely anecdotal, of course, but I am genuinely interested in any sort of empirical data that supports a single advantage that Node has over Go; it's certainly not performance, time to develop, readability (subjective), documentation, community...Well, start with one, and ask the question, "Are there any advantages/disadvantages to choosing the other?"
Personally, I find the mindset of the Go community to be wary of pulling in unnecessary dependencies, and favor writing it yourself, of perhaps copy/pasting some methods from a popular library, rather than depending on it. I also find more experienced developers preferring Go.
Node, on the other hand, seems to prefer pulling in whatever dependency has 1 method the developer would like to use, without any thought to how that will affect other developers, and/or the overall project.
All the above is purely anecdotal, of course, but I am genuinely interested in any sort of empirical data that supports a single advantage that Node has over Go; it's certainly not performance, time to develop, readability (subjective), documentation, community...