At Busbud we are big fans of Node.js and we use it for most of our projects: frontend applications, backend APIs, background workers…
Busbud covered my trip to the Node.js Interactive 2017 conference in Vancouver to learn more about the future of Node.js and to talk with passionate developers of the community.
Here are some notes I took during some of my favorites talks:
The world runs on Node.js. Everybody is using Node (see more here).
Node 8 with a new version of V8 is going to be a major change for the Node.js platform.
Node is a first-class citizen in V8.
In the past the V8 team at Google was really focused on Chrome but from now on the team is embracing Node.js: it has dedicated people to improve Node.js support in V8, and no commit can land in the project if it is breaking Node.
Node.js Performance and Highly Scalable Micro-Services - Chris Bailey, IBM
Chris Bailey presented the tooling, and the instrumentation necessary to run highly scalable microservices.
It is nice to see many standards appearing around Node.js microservice deployment:
- Docker to build containers
- Kubernetes to run containers in production
- OpenTracing and Zipkin to collect metrics accross multiple services
- Prometheus for monitoring
He also presented the appmetrics module which allows you to collect a lot of Node.js metrics and run CPU profiling. There are integrations with all the major monitoring systems (statsd, promotheus, etc.). Combined with the dashboard from appmetrics-dash, it is a good way to start monitoring your application perfomance.
You can also use
yo nodeserver to get a boilerplate Node.js microservice ready to deploy with all the instrumentation.
The Node.js Event Loop: Not So Single Threaded - Bryan Hughes, Microsoft
Modules using C++ primitives are different depending of the platform. For example,
child_process is using the C++ async primitive on Unix systems but thread pool on Windows.
Take Your HTTP Server to Ludicrous Speed, Matteo Collina, nearForm
He then showed us how to construct step by step a blazing fast HTTP framework:
fast-json-stringifyschema-based JSON rendering;
find-my-waya router built on a radix-tree;
- finaly presents
Fastifythat implements a lot of optimizations for performance.
For most uses, however,
express is fast enough, very popular and well supported.
High Performance JS in V8, Peter Marshall, Google
We also learned how V8 tries to optimize hot code (i.e. code frequently runned). The old optimizing compiler was doing too much guessing and premature optimization, causing it to be often wrong and actually creating deoptimizations. The new optimizing compiler TurboFan resolves this problem by guessing less.
Understanding and Debugging Memory Leaks in Your Node.js Applications - Ali Sheikh, Google
Debugging memory leaks is a problem that we had multiple times at Busbud, I was really excited to attend this talk.
After a brief introduction:
Don’t want any memory leaks? Don’t write any code or use anybody else’s! Memory leaks happen when objects expected to be short-lived get attached to long-lived ones.
rss and growing
heapUsed) and native leaks (growing
rss, but stable
He showed us the tools available to detect and fix memory leaks:
- Heap snapshot
- Allocation Timeline
- Sampling Heap Profiler (Doing a heap snapshop on a production environment is going to badly impact your application perfomance, the Sampling Heap Profiler will allow you to profile your application with very little performance impact)
What you need to remember from this talk: leaks are going to happen, be prepared and try these tools.
The Node.js Interactive 2017 was a great event, and I would like to thank the organizers for their hard work. It was a great occasion to meet the Node.js community and talk with other passionate actors of the ecosystem.
Photo by Scott Webb.