I've been investigating node.js lately. It looks like like a great and simple platform for building realtime collaboration type apps such as chatroom. See for example this post about how Plurk is now powering 100,000s of users communications over comet: http://amix.dk/blog/post/19490#Plurk-Instant-conversations-using-comet

Also, see the demo chatroom built on node.js: http://chat.nodejs.org/

Using node.js as an optional backend to Chatroom would go a long ways toward alleviating performance problems seen by some + significantly speed up message passing as Chatroom could now use comet vs. ajax polling.

What do you think?

I'm just throwing out ideas right now. I won't have time to write any code on this for quite awhile but I think this would be a really valuable approach and would love to help out at some point in the future.

Comments

Anonymous’s picture

i'm interested in exploring a backend that's not the standard LAMP stack, but i don't want to lose the tight integration aspects of a "standard" drupal module and its data.

i've actually toyed with building a prototype pub-sub setup using Apache ActiveMQ as the backend that clients connect to for the very-frequent-read operations.

the idea is that all write operations go via drupal, which writes out messages to the appropriate channel, and ActiveMQ (or some other similar backend) handles the real time updates. this model is a bit more complicated, but keeps the tight integration (all data is written to the drupal db and exposed to the full hook system), but the real-time keep-an-open-socket stuff is handled by another backend.

any interest in that sort of design?

kyle_mathews’s picture

I'd also suggest, if anything ever comes of this idea, that we use Socket.io. I was playing around w/ it yesterday and their sample chat room application and in about 20-30 lines of code, they've built a highly scalable, simple, hackable chatroom. Check out the code sometime from http://github.com/LearnBoost/Socket.IO and take it for a spin.

synodinos’s picture

Issue tags: +node.js, +nodejs

You can check out nodepal - A Drupal integration layer for Node.js developers

This is a module that allows the integration of a Drupal installation with a custom Node.js app. It provides an API so that Node.js developers can directly read and write in Drupal's repository, using constracts like node, user, permission, etc., with having to worry about the underlying implementation and setup of the Drupal installation.

Use Cases:

  • You have a working Drupal installation, with users, content, etc. and would like to add real-time services like chat, etc. The usual Apache-PHP-MySQL setup might not the best suited for this kind of apps, so you can develop you app in Node.js and hook it up to your Drupal, using the Nodelpal integration layer.
  • You want to build a new Node.js app, that has some notion of users, roles, permissions or content and would like to use Drupal's user, roles, permissions, content model and its great administrative interface, without having to build everything from scratch.
  • You want to build a new Node.js app and combine it with Drupal because there is some Drupal module that you find useful. E.g. you can add a Drupal forum, a Blog, or expose some content as a Web Service, or search it with Apache Solr. There is a Drupal module for everything :)
Anonymous’s picture

@synodinos - nice, i'll take a look.

afeijo’s picture

Also check this other new drupal module nodejs
very promissing, I'll definitely use it :)

rogical’s picture

+1 hope to see the D7 version of chartroom integrate with nodejs

superfedya’s picture

A lot of person use Drupal 6, so they will be very happy with nodejs in 6.x version too.