Nodeday 2014: State Of Node
NodeDay 2014: State of Node
Akbar S. Ahmed | Mar 30, 2014

Review of Node.js - Feb. '14

Toy language? Serious contender? Where does NodeJS and its ecosystem stand today? Node.js project lead TJ Fontaine tells you where we are, and were we’re headed.

Speaker

  • Name: TJ Fontaine
  • Title: NodeJS Project Lead
  • Company: Joyent
  • Twitter: @tjfontaine

Node Growth

I did not write down all of the stats, but the growth from 0.10.24 to 0.10.25 highlights the rapid growth of Node.js.

  • v. 0.10.25 has 538k downloads
  • v. 0.10.24 had 267k downloads

Download by operating system

  • 167 Linux
  • 106 Win
  • 103 Darwin
  • plus 1.127 million source downloads

Node on Windows is not to be ignored.

Node v. 0.12 (coming soon)

  • performance
  • streams3
  • http
  • dynamic tracing

buffer

  • slab allocator is gone
  • less gc pressure
  • attach external mem to arbitrary objects

tls/crypto

  • completely revamped
  • native engines
  • consistent error handling - you may get more errors now b/c they were not handling errors correctly previously
  • hardware crypto is now native

streams3

  • flowing and paused
  • cork/uncork: cork is a way to group multiple writes so that they can be flushed once which results in fewer sys calls

http

  • proper keepalive
  • agent.maxFreeSockets, maxSockets: maxSockets is now infinity, so I will need to worry about file descriptor limits on the OS
  • access to raw headers and trailers

execSync/spawnSync

  • caveat emptor
  • be careful with this command b/c if you try to kill an external process that does not want to die your node process will be permanently blocked

I think there is a lot of opportunity to help developers who are new to Node / JavaScript to better understand how to write good async code. Several senior members of the community expressed how sync code in Node is bad and wondered why the above sync APIs were so heavily requested.

dynamic tracing

  • async listener
  • tracing interface
  • v3 probes

Allows you to be very explicit about what you want to trace. These are implicit probes.

If this is an API that I’ll use then I should speak with the Node devs. The reason is that tracing an async process with an async listener results in nonsensicalness (and quickly).

Consistency

  • focus is to keep all builds for all platforms green

Node 1.0

  • stable addon layer
  • exposing well defined APIs
  • contributions yet to be seen
  • will have a normal roadmap
  • have not nailed the 1.0 interface yet
  • will have a stable C interface

What are the features that we (the community) would like? The Node devs need to know this so that they can move forward based on the community’s needs.

It’s important to get involved in the shaping of Node. The Node devs don’t have visibility into how everyone is using Node so providing input really helps them help us.

They are working on improving the web site infrastructure.

What types of documentation would we like to see? Such as, how to use Node specifically?

They are also looking for people who want to take responsibility for parts of the Node infrastructure.

Q&A

Why are domains bad?

This is a feature that should be used sparingly, and only if you really understand what they should be used for. Domains are used for unexpected exceptions. Use case is for large chat systems or complex ecomm where there is a lot of state, and when an error occurs, you need to know how much state can be recovered and how your app can recover without a complete restart.

Audience asked something about clusters (sorry, didn’t catch the question)

cluster is round robin by default now.

There is talk about adding a scheduling, but nothing is done yet.

Message passing from parent to child is sync and involves json parsing.

If you are sharding (scaling horizontally), then you’re better off having 1 node process per CPU and then running a separate load balancer out front.

The question was something about node and CPU intensive work

I wrote something like “In the future it may make sense to look at threading”. I don’t know if I wrote this as a response from the speaker of if this was my note to self. Either way, I’ll update the post once the video comes out.

Use C++ layer for CPU intensive work.

When will 0.12 be released?

No date yet. However, 0.12 will be released very soon.




Subscribe to our newsletter

Contact Information

ABOUT EXPONENTIAL.IO

We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.

LOCATION

All courses are made with love in
Palo Alto, CA.

Subscribe to our newsletter