NodeJS Presentation on August 27, 2010

6 views
Skip to first unread message

Jaime Bueza

unread,
Aug 28, 2010, 10:11:14 PM8/28/10
to Blast Mojo
Hey all,

I gave a talk to front-end and back-end developers on Friday (August
27) about NodeJS (async programming, server side Javascript, and event
loop vs threads), here are my quick slides (http://github.com/
downloads/jbueza/presentations/ID_Meeting_-_NodeJS_official.pdf) but
the reason why I'm sending this message is because of how NodeJS is
completely changing the game in terms of scalability and using JS on
the backend. That said, Douglas Crockford also just did a presentation
on Loopage (August 27): http://bit.ly/duCFAh . He talks about how
event-driven non-blocking I/O (NodeJS) is done RIGHT and how
Javascript is now leading innovation on the web! That's the HD version
for download and I think it'll be up on YUI Theatre for stream maybe
next week.

Cheers,
Jaime

Paul Ortchanian

unread,
Aug 29, 2010, 2:33:08 PM8/29/10
to blast...@googlegroups.com
Hey Jamy,

This is great as it's the New frontier of Backend Javascript we all need to explore and start using. Douglas Crockford gave an interesting lecture about that at Yahoo on Firday, I think the video is online now :

Jaime Bueza

unread,
Aug 30, 2010, 4:37:37 AM8/30/10
to blast...@googlegroups.com
I put the HD version up on Schein \\ Temp \\ Jaime of his august 27 2010 Loopage talk.

Cheers,
Jaime

Paul Ortchanian

unread,
Aug 31, 2010, 2:19:21 AM8/31/10
to blast...@googlegroups.com

Ryan Dahl is the creator of node.js  And here are a few interesting leads on where to get started with server side javascript.


If your wondering what's this for. Quick non geeky over simplified example :  Imagine 1000 browsers hiting your new website executing an ajax request on page load for a JSON object..... That's 1000x effort for the client side to make the AJAX call and 1000x effort for the BE to render and send you the JSON.....pattern is that it's sending you the same JSON 1000 times!

Instead with Node.js the first instance of the browsers AJAX request would do the usual process but allow for the following 999 requests to take a vacation and sip pina colada's as the request results would reside on the servers memory never to be deleted again....ever....avoiding the execution process 999 times........every day, for every new visitor. 

you guessed it : Faster Performance acheived by putting the extra process on another machine (server) who happens to have memory longer than the length of a browser session.  

Now let's hear some Pina Colada songs : http://mp3bear.com/jimmy-buffett-if-you-like-pina-coladas

p

On Sat, Aug 28, 2010 at 7:11 PM, Jaime Bueza <jbu...@gmail.com> wrote:

Jaime Bueza

unread,
Aug 31, 2010, 4:01:07 AM8/31/10
to blast...@googlegroups.com
Hrmmmm... I don't believe that's how it works. Perhaps I misread what you wrote but If you had 1000 concurrent users, a NodeJS application server would be able to serve those users easily on one thread (Event Loop, asynchronously non-blocking); however, in a traditional Apache Tomcat setup, you'd have to spawn 1 thread per connection (1000 users = 1000 threads)...so you'd end up consuming way more memory and have to bring in load balancers than a NodeJS application server would use.

It seems like a lot of open source high performance web servers are following in the non-blocking event driven I/O. Nginx, lighttpd, and Mongrel2 just to name a few.

I'm not too sure about whether it caches the response like you've said though, I could be wrong about the V8 JS engine but I think the only real micro-optimizations on the backend is V8 tries to figure out patterns in your execution sequences, much like PHP APC.

The main win with using NodeJS as a platform is the fact that you can port existing heavy-lifting code from the front-end to the back-end, such as, calculating map clusters like on Kiwi's Google Map, sorting huge JSON data sets, or distributing computing power globally based on idle connections (http://maprejuice.com/). Additionally, its inherent non-blocking I/O gives your project a better, more understandable way of developing applications (we're used to the event driven architecture), and its sheer performance.

There's a few really neat applications from the NodeJS Knockout competition (http://nodeknockout.com/) open for voting, like, an MMO Tetris, MMO Scrabble, Multiplayer typing games, and more.

Paul Ortchanian

unread,
Aug 31, 2010, 11:18:16 AM8/31/10
to blast...@googlegroups.com
Hi Jaime,

Nodecast keeps track of messages using an in-memory JavaScript array, which works fine until you restart the server and lose everything. 

 ex: writing a simple hit counter using node : http://hublog.hubmed.org/archives/001927.html

I know it goes deeper then that ..... way way deeper to stuff I don't even comprehend but I wanted to give a practical example of how we could use something like the db object to store JSON strings server side and prevent the client side from executing extra work over and over again.

As far as BR ID is concerned, the work avoidance from the FE as well as the accompanying perfromance increase is reason enough to look into this new JS revolution ;-)

oh...did I mention this might lead to having BE dev's writing JavaScript, unless we take it on......

p

Jaime Bueza

unread,
Aug 31, 2010, 2:47:16 PM8/31/10
to blast...@googlegroups.com
Nodecast looks pretty slick.

I've compiled a list of things that are essential to developing a project (in terms of technology):

PHP:
  • Database: MySQL or any other
  • ORM: Doctrine
  • MVC Framework: Symfony
Ruby: (Luscher can correct me on these!)
  • Database: MySQL or any other
  • ORM: ActiveRecord
  • MVC Framework: Rails
NodeJS:
  • Database: MongoDB
  • ORM: Mongoose
  • MVC Framework: ExpressJS
  • Front-end: Blast Mojo

As you can see, people would be developing on a technology stack that would mirror any other Tomcat, LAMP, or Rails stack but would have more potential in quicker development cycles (many people are quite strong in Javascript, no compiling, fast deploys). I've seen a few MySQL, MongoDB, CouchDB connectors for NodeJS but nothing about Oracle or MS SQL. They would need to develop these libraries in non-blocking asynchronous I/O first before actually moving towards making it production-level ready. I really don't think it's that far away from people starting to adopt it as a regular application server.

Having Blast Mojo on the front-end would allow for some really creative publish/subscribe, you'd be able to pass JS messages easily between the server and your controllers. That'd be pretty neat.

It would be an awesome and interesting situation where a front-end developer can jump in and fix a few backend issue because it's the same language!

Cheers,
Jaime

Jaime Bueza

unread,
Aug 31, 2010, 3:27:15 PM8/31/10
to blast...@googlegroups.com
Palm WebOS adopts NodeJS: http://almaer.com/blog/node-is-our-turtle-shell-node-js-now-powers-services-on-webos

Using NodeJS for network, file I/O, and data processing!
Reply all
Reply to author
Forward
0 new messages