Posted on May 6, 2011 // Short URL

Alex Barth on Node.js and Express versus Drupal

Alex Barth talks about Development Seed's recent focus on using technologies like node.js, Express and CouchDB. He compares this Server-side JavaScript stack as best he can to what Drupal does with the LAMP stack, as well as how this node.js/Express approach is better suited for dealing with data-intensive web applications. Development Seed has been using it for Tilemill and Tilestream Hosting, but node.js it not used in their iOS application MapBox for the iPad.

As described in this developerWorks article, "Node.js is a server-side JavaScript interpreter that changes the notion of how a server should work. Its goal is to enable a programmer to build highly scalable applications and write code that handles tens of thousands simultaneous connections on one, and only one, physical machine."

Node.js itself is written in C/C++ since it's built on top of Google V8 JavaScript Engine, but the applications like Express are written in JavaScript.

Again quoting a developerWorks explanation:

The V8 JavaScript engine is the underlying JavaScript engine that Google uses with their Chrome browser. Few people think about what actually happens with JavaScript on the client. A JavaScript engine actually interprets the code and executes it. With V8, Google created an ultra-fast interpreter written in C++ that has another unique aspect; you can download the engine and embed it in any application you wish. It's not restricted to running in a browser. Therefore, Node actually uses the V8 JavaScript engine written by Google and re purposes it for use on the server.

Node.js and it's JavaScript applications are event-based instead of linear like PHP. For example, if you do a MySQL query in PHP, that means you have to wait for the response to come back before you can continue. Node.js on the other hand sets up a handler for "when the MySQL query finishes, execute this function." This means that you can do other stuff while the MySQL query (or any other activity that takes a lot of time) finishes.

Barth talks more about how Development Seeds enjoys the elegance of being able to processing large chunks of data stream in real-time as soon as the first bytes of the data are received, and he talks about what the Express framework does and does not provide in the equivalent Drupal speak of terms and hook functions.

I also got a chance to talk with ZivTech's Justin Rendell at DrupalCon Chicago, who has written a Node.js Integration Drupal module in order to do real-time chatting a better experience with other modules like the Chat Room module. I'll be releasing that interview next week. UPDATE: Here's that interview with Justin Randell.

Interestingly, most of the development of node.js development is being coordinated through github, and since there's no centralized repository or issue queue, most features/bug fixes come in as pull requests on this GitHub repository: https://github.com/joyent/node/pulls

Node.js also just held a one-day NodeConf in Portland, OR, which over half of Development Seed attended. Barth talks about how node.js is still an emerging technology, but is really excited to see it mature over the next couple of years.

Comments

gmclelland

Wrong Download File

Nice techno, but I thing you uploaded the wrong file. It just plays music, no podcast.

-Dooh

Glenn

Reply

sirkitree

working now

Sorry about that - we had an incorrect file uploaded. I was pretty surprised when i started playing it myself ;) Great tune though... Around the world, around the world..

Reply

emsbrooklyn

Daft Punk'd

Downloaded podcast was 'Around the World' by Daft Punk and not Alex Barth - unless he typically speaks in vocoder with a hooky bassline backbeat - and my puny human brain is incapable of parsing it's real meaning.

Reply

kentbye

Sorry

I accidentally labeled and uploaded the wrong file in iTunes. It should be working now if you play it here. Let us know if you're able redownload the right one.

Reply

AdamGerthel

Interesting talk, but I find

Interesting talk, but I find it scary how the questions were aimed a getting DS to justify why they left Drupal for NodeJS. Drupal is a CMS, and a good one at that. NodeJS is far from a CMS. There are probably hundreds of reasons why DS went in the direction they did, but the community can't blame them for that. If Drupal wasn't a fit for what they were doing then so be it. Drupal is great, but it can't do and be everything.

Reply

Anonymous

how many more Dev Seeds?

I wonder why one of the best Drupal shops in the world has given-up on Drupal ?

the investment in Drupal by Dev Seed must mean there is either a really good reason to do Node.js and/or a really good reason NOT to do Drupal

Dev Seed dont even use Open Atrium for support of TileMill

is it the business ecology ? i.e the emergence of a certain corporate services company ? Starts with A, ends in a ? is it crowding out others ? sucking resources out of too many niches ?

is D7 sucky for Dev Seed ? the smallcore issue ?

is supporting Drupal projects and distro's just bad business ?

is the Drupal community itself withering under commercialization ?

is it just more fun and less hassle to dev in a new tool without the noobs on d.o ?

whats happening to Adrian now Aegir 1.x is launched ?

its not just a technical issue.

Dev Seed invented the entire Spaces+Context+Features paradigm, hosted the lead developer for Aegir, pioneered make files

and now, they are just walking away from all that, divesting and starting again ?

its the economy, stupid!

http://chicago2011.drupal.org/sessions/drupal-framework-vs-drupal-platform

http://groups.drupal.org/node/135109

http://www.examiner.com/drupal-in-national/drupal-distributions-flux-2011

Reply

Michael Prasuhn

IBM article is rather poor

While normally IBM Developerworks is a great source for articles (their Drupal articles are excellent) the node.js article is rather poor quality and really misses some major points. Comments such as:

Currently, Node doesn't provide a default way to create dynamic pages.

while technically correct fail to miss the point that node.js is not a language like PHP or JSP. Nor is it a webserver like Apache or Tomcat, yes the author draws negative comparisons with both categories. I.e. how can a framework lack features of another programming language, and features of a webserver at the same time?

There are tons of great articles about understanding what makes node.js different from most of what's out there. I'd recommend checking out http://howtonode.org/ or http://nodetuts.com/ for anyone who is genuinely interested in learning more about node.js.

Reply

perusio

Wrong turn of the woods

While devseed is free to leave drupal and proceed a different avenue that seem more valuable from a bizdev point of view I find the nodeJS hype really boring.

nodeJS author claims that his creation draws from Nginx. Well this is what the author of Nginx has to say about V8 (which is the basis of nodeJS).

http://sysoev.ru/prog/v8.html (in Russian use google translate).

Reply