What Is New in Node.js 0.12?
| Category | Change |
|---|---|
| New Features | cluster: round-robin load balancing for worker processes |
| New Features | Synchronous child_process.exec family |
| New Features | TLS: SNI and OCSP stapling support |
| New Features | TLS: multi-key/cert pairs per server |
| Improvements | V8 3.28 -- Promises, generators (partially) |
| Improvements | HTTP/HTTPS: max sockets configurable |
| Improvements | Streams: improved pipe reliability |
| Security | OpenSSL 1.0.1r |
Cluster Round-Robin Scheduling
Node.js 0.12 finally makes the cluster module actually balance load across workers. Prior to 0.12, the OS handled connection routing to worker processes, which led to uneven distribution -- some workers were overloaded while others sat idle.
With round-robin scheduling (the default on Linux), the master process distributes each incoming connection to the next worker in rotation. On Windows, the OS handles balancing. This makes multi-core utilization much more predictable.
import cluster from 'node:cluster';
import http from 'node:http';
import { cpus } from 'node:os';
if (cluster.isMaster) {
cpus().forEach(() => cluster.fork());
} else {
http.createServer((req, res) => res.end('ok')).listen(3000);
}
TLS Enhancements -- SNI and OCSP Stapling
Server Name Indication (SNI) lets a single TLS server host multiple virtual domains, each with its own certificate -- essential for shared hosting and multi-tenant HTTPS servers. OCSP stapling lets the server include a cached certificate revocation status in the TLS handshake, reducing latency and load on the certificate authority's OCSP responder.
These features bring Node.js's TLS stack to parity with Nginx and Apache for common HTTPS hosting scenarios.
Native Promises in V8 3.28
V8 3.28 ships a native Promise implementation (conforming to Promise/A+). This is the first version of Node.js with native promises -- previously you had to use bluebird, q, or similar libraries.
Native promises perform well but lack some of the utility methods (like .map(), .spread()) that Bluebird provides. Most teams used a mix: native promises for new code while legacy code retained Bluebird for the richer API.
FAQ
Is Node.js 0.12 an LTS release?
Node.js 0.12 predates the formal LTS program (which starts with Node.js 4). It received extended maintenance through April 2017 informally. Now fully end-of-life.
Should I use native promises from 0.12 or stick with Bluebird?
For new codebases starting on Node.js 0.12, native promises are fine. For existing code heavy on Bluebird's .map()/.all()/.props() utilities, stay on Bluebird or wrap native promises. Bluebird also has better performance on some V8 3.x versions.
How does cluster round-robin affect sticky sessions?
Round-robin does not preserve which worker handles a client's session. For stateful WebSocket connections or session-dependent routes, use an external session store (Redis) or a load balancer that supports IP hash or cookie-based affinity.
Does 0.12 support ES6 at all?
Partially, via V8 3.28. let, const, arrow functions, and classes require the --harmony flag. Native promises are the only ES6 feature available by default. Full ES6 ships in Node.js 4-6.
Is there a migration guide from 0.10 to 0.12?
The main changes are the cluster scheduler, TLS API additions, and stream behavior refinements. The Node.js project maintained API change notes at the GitHub wiki that document the delta between versions.