(2009-11-30) NodeJs

Simon Willison describes Ryan Dahl's NodeJs project, which creates an ASynch Event Based server in JavaScript. Node creator Ryan Dahl has a stated aim for Node to never provide a blocking API - even File System access and DNS lookups are catered for with non-blocking callback based APIs. This makes it much, much harder to screw things up.

How do you implement Persistent Storage? For the moment, the easiest answer lies with the NoSQL ecosystem. Node's focus on non-blocking I/O makes it hard (but not impossible) to hook it up to regular database client libraries. Instead, it strongly favours databases that speak simple protocols over a TCP-IP socket - or even better, databases that communicate over HTTP. So far I've tried using CouchDB (with node-couch) and redis (with redis-node-client), and both worked extremely well. nodecast trunk now uses redis to store the Message Queue, and provides a nice example of working with a callback-based non-blocking database interface.

Edited: |

blog comments powered by Disqus