Nodejs + Rails

1,673 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,673
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Nodejs + Rails

  1. 1. Rails + Node.js Michał Łomnicki http://mlomnicki.com http://starware.com.pl
  2. 2. Node.js server-side JS asynchronous processing events, reactor pattern, eventmachine http, tcp, dns are first class protocolsbuilt on top of Googles V8 JavaScript engine uses epoll, kqueue, /dev/poll or select
  3. 3. Show me some codevar 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. 4. Why JavaScript? first class events support people know it already! easy to start dont have to learn new language
  5. 5. Why to Node? handle lots of concurrent requests speed ...but concurency is more important IMO streaming dataauthentication layer between client and storage WebSockets Chunked requests/responses small memory footprint
  6. 6. Why NOT to Node? its not a web framework ... so its not a rails replacementuse 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. 7. My use-case - tracer trace users behaviour clicked links inputs "hot" areas sth like GoogleAnalytics but very customized
  8. 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
  9. 9. Users compete with traces
  10. 10. Waiting users = unhappy users
  11. 11. Happy users and happy traces
  12. 12. Show me numbers! Query database and return OKNote: it lies a bit. Everything runs on default settings
  13. 13. Questions?

×