node.js
evented I/O for V8 javascript
the Problem
the Problem
the Problem
the Problem
the Problem

file uploads
the Problem

file uploads
long database transactions
the Problem

file uploads
long database transactions
external web resource
blocking I/O
solutions
solutions
solutions


worker queues
solutions


worker queues
poll for results
event-driven I/O
event-driven I/O
event-driven I/O

nginX + Lua
event-driven I/O

nginX + Lua
Twisted (Python)
event-driven I/O

nginX + Lua
Twisted (Python)
EventMachine (Ruby)
node.js
node.js
node.js


Google’s V8 engine + async I/O
node.js


Google’s V8 engine + async I/O
CommonJS modules
demo time
simple HTTP server
start it
simulate wait
benchmark
HTTP remote fetch
HTTP proxy
advantages
advantages
advantages
JS has event-handling built-in
advantages
JS has event-handling built-in
clean-room design w/o blocking APIs
advantages
JS has event-handling built-in
clean-room design w/o blocking APIs
small memory footprint
advantages
JS has event-handling built-in
clean-room design w/o blocking APIs
small memory footprint
fast
advantages
JS has event-handling built-in
clean-room design w/o blocking APIs
small memory footprint
fast
shareable code
drawbacks
drawbacks
drawbacks


chained callbacks
drawbacks


chained callbacks
larger codebase maybe hard to maintain
frameworks
frameworks
frameworks

connect
frameworks

connect
express
frameworks

connect
express
persevere
what’s next
what’s next
what’s next

coroutines / continuations
what’s next

coroutines / continuations
real concurrency
what’s next

coroutines / continuations
real concurrency
Erlang / Haskell
questions?

Node.js Presentation Rotterdam.PHP