SlideShare a Scribd company logo
Rails + Node.js
  Michał Łomnicki
   http://mlomnicki.com
   http://starware.com.pl
Node.js
                server-side JS
          asynchronous processing
   events, reactor pattern, eventmachine
    http, tcp, dns are first class protocols
built on top of Google's V8 JavaScript engine
   uses epoll, kqueue, /dev/poll or select
Show me some code
var http = require('http');
http.createServer(function (req, res) {

 res.writeHead(200, {'Content-Type': 'text/plain'});
 res.end('Hello Worldn');

}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');
Why JavaScript?
    first class events support
     people know it already!
           easy to start
 don't have to learn new language
Why to Node?
      handle lots of concurrent requests
                    speed
   ...but concurency is more important IMO
                streaming data
authentication layer between client and storage
                 WebSockets
        Chunked requests/responses
            small memory footprint
Why NOT to Node?
                 it's not a web framework
             ... so it's not a rails replacement
use Node to handle sepcialized, performance criticial tasks
 eventmachine, async_sinatra, erlang, etc are good too!
  ... but Node.js libraries are proven to be asynchronus
        we are used to think in synchronous way
                  Fibers, Goliath server
My use-case - tracer
            trace user's behaviour
                 clicked links
                    inputs
                 "hot" areas
 sth like GoogleAnalytics but very customized
My use-case - tracer
               a lot of requests
 simple logic - get data, write it do DB, return
        want to plug it into more apps
Users compete with traces
Waiting users = unhappy users
Happy users and happy traces
Show me numbers!
           Query database and return OK




Note: it lies a bit. Everything runs on default settings
Questions?

More Related Content

PDF
Fronteers 20131205 the realtime web
PPTX
Node js crash course session 2
PPTX
Native DB transactions
PDF
Getting started with node JS
PDF
AJAX in ASP.NET
PDF
Nodejs - ITVoyagers
PDF
Asynchronous Processing in Java/JEE/Spring
Fronteers 20131205 the realtime web
Node js crash course session 2
Native DB transactions
Getting started with node JS
AJAX in ASP.NET
Nodejs - ITVoyagers
Asynchronous Processing in Java/JEE/Spring

What's hot (20)

PDF
Scaling Twitter
PDF
Server-Sent Events (real-time HTTP push for HTML5 browsers)
PDF
3rd Generation Web Application Platforms
PPTX
Interview questions on asp
PDF
ESNext, service workers, and the future of the web
PDF
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
PPTX
Introduction about-ajax-framework
PDF
Embracing the Future
PPTX
PDF
Consuming Web Services in Android
ODP
Compress
PDF
Servlet and JSP
PPT
PPTX
Rest api with node js and express
PDF
Node.js primer
PPTX
Teaching old java script new tricks
PDF
Web Development with AngularJS, NodeJS and ExpressJS
PDF
Multithreading and Actors
PPTX
Webinar slides "Building Real-Time Collaborative Web Applications"
PPT
Inner core of Ajax
Scaling Twitter
Server-Sent Events (real-time HTTP push for HTML5 browsers)
3rd Generation Web Application Platforms
Interview questions on asp
ESNext, service workers, and the future of the web
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
Introduction about-ajax-framework
Embracing the Future
Consuming Web Services in Android
Compress
Servlet and JSP
Rest api with node js and express
Node.js primer
Teaching old java script new tricks
Web Development with AngularJS, NodeJS and ExpressJS
Multithreading and Actors
Webinar slides "Building Real-Time Collaborative Web Applications"
Inner core of Ajax
Ad

Viewers also liked (7)

PDF
Ruby tricks2
PDF
Having fun with legacy apps
PDF
Schema plus
PDF
ACID - Transakcje
PDF
DDD, Rails and persistence
PDF
Cap Theorem
PPTX
Tradycyjne indeksy w sql server
Ruby tricks2
Having fun with legacy apps
Schema plus
ACID - Transakcje
DDD, Rails and persistence
Cap Theorem
Tradycyjne indeksy w sql server
Ad

Similar to Nodejs + Rails (20)

KEY
Synchronous Reads Asynchronous Writes RubyConf 2009
PPTX
Building and Scaling Node.js Applications
PDF
Node.js
PPT
Server side JavaScript: going all the way
PDF
Node PDX: Intro to Sails.js
PDF
node.js practical guide to serverside javascript
PDF
Nodejs - A quick tour (v6)
PPTX
StrongLoop Overview
PDF
Node.js Course 2 of 2 - Advanced techniques
PPT
Node js
PDF
SocketStream
PPT
JS everywhere 2011
KEY
20120306 dublin js
PPTX
Mobile gotcha
PDF
Intro to Sails.js
PDF
Nodejs - Should Ruby Developers Care?
PDF
Modern Architectures with Spring and JavaScript
KEY
20120802 timisoara
KEY
Practical Use of MongoDB for Node.js
PDF
Seattle StrongLoop Node.js Workshop
Synchronous Reads Asynchronous Writes RubyConf 2009
Building and Scaling Node.js Applications
Node.js
Server side JavaScript: going all the way
Node PDX: Intro to Sails.js
node.js practical guide to serverside javascript
Nodejs - A quick tour (v6)
StrongLoop Overview
Node.js Course 2 of 2 - Advanced techniques
Node js
SocketStream
JS everywhere 2011
20120306 dublin js
Mobile gotcha
Intro to Sails.js
Nodejs - Should Ruby Developers Care?
Modern Architectures with Spring and JavaScript
20120802 timisoara
Practical Use of MongoDB for Node.js
Seattle StrongLoop Node.js Workshop

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
A Presentation on Artificial Intelligence
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
cuic standard and advanced reporting.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
A Presentation on Artificial Intelligence
MIND Revenue Release Quarter 2 2025 Press Release
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Spectroscopy.pptx food analysis technology
Programs and apps: productivity, graphics, security and other tools
cuic standard and advanced reporting.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25-Week II
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Nodejs + Rails

  • 1. Rails + Node.js Michał Łomnicki http://mlomnicki.com http://starware.com.pl
  • 2. Node.js server-side JS asynchronous processing events, reactor pattern, eventmachine http, tcp, dns are first class protocols built on top of Google's V8 JavaScript engine uses epoll, kqueue, /dev/poll or select
  • 3. Show me some code var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/');
  • 4. Why JavaScript? first class events support people know it already! easy to start don't have to learn new language
  • 5. Why to Node? handle lots of concurrent requests speed ...but concurency is more important IMO streaming data authentication layer between client and storage WebSockets Chunked requests/responses small memory footprint
  • 6. Why NOT to Node? it's not a web framework ... so it's not a rails replacement use Node to handle sepcialized, performance criticial tasks eventmachine, async_sinatra, erlang, etc are good too! ... but Node.js libraries are proven to be asynchronus we are used to think in synchronous way Fibers, Goliath server
  • 7. My use-case - tracer trace user's behaviour clicked links inputs "hot" areas sth like GoogleAnalytics but very customized
  • 8. My use-case - tracer a lot of requests simple logic - get data, write it do DB, return want to plug it into more apps
  • 10. Waiting users = unhappy users
  • 11. Happy users and happy traces
  • 12. Show me numbers! Query database and return OK Note: it lies a bit. Everything runs on default settings