1 minute read

Node js initial thoughts

I’ve recently switched jobs (woo) and with that comes a lot of change. It is in the consulting field, so I view myself as a mercenary tasked to solve business problems and earn $$$ for the company. As it is, I get to learn a lot of different tech stacks and paradigms as I hone my marketable skills. For the time being, I’m on the bench (read: not on a client project). This week I got a chance to peruse node.js.

A few thoughts:

  • Event-driven non-blocking architecture is pretty cool. I had to look up an article on SO to explain the concept, but it seems that single-threaded architectures are better for I/O bound workloads and not CPU-bound ones. A really great explanation of the concept is thinking about having many waiters (threads) taking orders and focusing on executing just that one order (multi-threaded) versus a single waiter taking everyone’s orders and processing them all at the same time, waiting on notifications from the kitchen for next steps (single-thread events)

  • The code that I’ve seen is pretty straightforward. There are a bunch of listeners and emitters, and that’s it. socket.on('someEvent', function() => {}); and socket.emit('someEvent')

Honestly, haven’t learned all that much yet. I’ll throw in some more thoughts later.