Skip to content

Instantly share code, notes, and snippets.

@fariszacina
Last active May 13, 2018 21:13
Show Gist options
  • Select an option

  • Save fariszacina/9338e456152ba91582102d3b4a718716 to your computer and use it in GitHub Desktop.

Select an option

Save fariszacina/9338e456152ba91582102d3b4a718716 to your computer and use it in GitHub Desktop.
Design Decisions - Node.js

Node.js Design Decisions - a.k.a. Why?

This is a list of design decisions to support version 0.2 of the Node.js library

Maintainability

  • We want to make it simple to work with asyncronous IO
  • No function should direct perform I/O. Use callbacks instead
  • Have built in support for important protocols (TCP, DNS, HTTP) and support many HTTP features (chunked requests, keep alive, comet etc.)
  • The API should be both familiar to client-side JS programmers and old school UNIX hackers.
  • Be platform / operating-system independent
  • Reuse solid platforms (Google V8) and minimize dependencies (python only)
  • Use JavaScript since it's designed to be used in an event-loop

Scalability

  • I/O needs to be done differently from traditional systems. Other threads of execution should run while waiting. We are inspired by NGinx and the event loop.
  • Stream everything; never force the buffering of data

Note: These decisions are copied from the original Node.js paper by Ryan Dahl and adapted to this format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment