Conquering the Server Side with Node.JS      StartTechConf 2011         Caridy Patiño                                 Sear...
Saturday, November 5, 2011
La industria esta cambiando                                muy rápidoSaturday, November 5, 2011
Chrome + V8Saturday, November 5, 2011
Internet de alta velocidadSaturday, November 5, 2011
Coulds / NubesSaturday, November 5, 2011
WebApps & AppsSaturday, November 5, 2011
Almazenamiento MásivoSaturday, November 5, 2011
La web en tiempo realSaturday, November 5, 2011
Y esto se traduce en...Saturday, November 5, 2011
Peaks / PicosSaturday, November 5, 2011
ConcurrenciaSaturday, November 5, 2011
ConcurrenciaSaturday, November 5, 2011
Saturday, November 5, 2011
ut                                  O                              old                             S   Microsoft VBScript ...
DesempeñoSaturday, November 5, 2011
Soluciones...Saturday, November 5, 2011
Más servidoresSaturday, November 5, 2011
Más servidores                                 $$$$$Saturday, November 5, 2011
Nubes ElásticasSaturday, November 5, 2011
Wow Amazon EC2 Is Expensive For Start Ups                 “With EC2, I would pay 30 days * 24 hours * $0.1 * 1.19 (tax) = ...
Delegar procesos hacia el clienteSaturday, November 5, 2011
Saturday, November 5, 2011
Node.JSSaturday, November 5, 2011
Server Side JavaScript                                     (SSJS)Saturday, November 5, 2011
NarwhalJS           RingoJS                       Wakanda                                  Rhino   AkshellSaturday, Novemb...
Nuestros sistemas operativos y lenguajes derivan de los               sistemas diseñados para teletipos.Saturday, November...
Las plataformas modernas de software siguen imitando                     estas interfaces antiguas.Saturday, November 5, 2...
“Blocking system call” is a call into the kernel which waits for          some I/O to complete before before returning. Bl...
Los procesos son buenos para mantener unidades           aisladas. Sin embargo, son demasiado pesados como                ...
Uno de los objetivos principales de Node es hacer          accesible la programación sin bloqueo para aquellos            ...
Node ha tenido éxito en poner                             servidor de alto desempeño al                             alcanc...
Un solo stack por cada procesoSaturday, November 5, 2011
Node.JS solo tiene 2.5                             años de edad.                             La version 0.6 es la 3ra     ...
Saturday, November 5, 2011
HTTP benchmark con 100 clientes concurrentes                             en OSX 10.6             - v0.2.6 5330 req/sec    ...
Por qué Javascript?Saturday, November 5, 2011
Javascript es el lenguaje                                  del navegadorSaturday, November 5, 2011
Javascript es un lenguaje                                     dinámicoSaturday, November 5, 2011
Closures y programación asincrónica                    por naturalezaSaturday, November 5, 2011
Comunidad creciente, activa y diversaSaturday, November 5, 2011
http://github.com/languagesSaturday, November 5, 2011
No existe otro lenguaje que pueda               destronar a javascript en un                      future cercanoSaturday, ...
Node Event LoopSaturday, November 5, 2011
var result = db.query("select * from T");   // use resultSaturday, November 5, 2011
var result = db.query("select * from T");   // use result                             Qué esta haciendo el software       ...
db.query("select * from T", function (result) {       // use result   });Saturday, November 5, 2011
db.query("select * from T", function (result) {       // use result   });                             Este código le permi...
Node maneja todas los IO de la misma maneraSaturday, November 5, 2011
Saturday, November 5, 2011
Menos memoria necesita ser usada, y un mayor         rendimiento debido al menor número de cambios de                     ...
El uso de los closures para capturar el estado entre                            diferentes eventosSaturday, November 5, 2011
function adicionar(callback) {      http.get(url1, function(respuesta1) {          var parte1 = respuesta1.data;          ...
Node StackSaturday, November 5, 2011
Como usar NodeSaturday, November 5, 2011
Download, configure, compile, and                       make install it:                             http://nodejs.org/Satu...
Windows Build (Node v0.6.0):        http://nodejs.org/dist/v0.6.0/node.exeSaturday, November 5, 2011
NPM                             http://npm.org/Saturday, November 5, 2011
curl http://npmjs.org/install.sh | shSaturday, November 5, 2011
NPM 101                              $ npm help                              $ npm install <pkgName>                      ...
$	  npm	  list                             app@0.1.0	  /Users/caridy/node/app                                          	  ...
Express                             http://expressjs.com/Saturday, November 5, 2011
$ cd my/node/app/                             $ npm install expressSaturday, November 5, 2011
Requiriendo Express NPM Module                       var app = require(express).createServer();                       app....
$ node app.jsSaturday, November 5, 2011
http://localhost:3000/usuario/caridySaturday, November 5, 2011
Express Boilerplate                             $ npm install -g express                             $ cd my/node/app/    ...
YUISaturday, November 5, 2011
Saturday, November 5, 2011
$ npm install yui3Saturday, November 5, 2011
var YUI = require("yui3").YUI;               Requiriendo YUI NPM Module       YUI().use(json, io, function(Y) {           ...
var YUI = require("yui3").YUI;                           Requiriendo YUI NPM Module            YUI().use(yql, function(Y) ...
{                              "query": {                               "count": 15,                               "create...
YUI Library          Who contributes?                               Everyone, with committer review.                 YUI G...
Yahoo! CocktailsSaturday, November 5, 2011
Saturday, November 5, 2011
Cocktails: MojitoSaturday, November 5, 2011
Mojito es un                             Web Application FrameworkSaturday, November 5, 2011
Mojits MVC                                      Controller                       Model                                    ...
Tres tipos de scripts:                             - foo.server.js                             - foo.common.js            ...
Multiples Runtimes             Javascript on the   Native Bridges   Javascript on the                 browser         iOS ...
Mojito Command 101                               $ mojito help                               $ mojito create app ./myApp  ...
Mojito Application Folder                              ./myApp                              - application.json            ...
Open Source a inicios del 2012Saturday, November 5, 2011
Cocktails: ManhattanSaturday, November 5, 2011
Yahoo! Manhattan es un ambiente de hosting para            aplicaciones basadas en Mojito que utiliza la nube de          ...
Server Side: Technology Stack                                                                Mojito App                   ...
Yahoo! Manhattan extiende Node.JS para proveer fault-      isolation & fault-tolerance, escalabilidad, disponibilidad,    ...
Saturday, November 5, 2011
Manhattan provides a simple interface for developers to        deploy, un-deploy and manage their Mojito-based      applic...
DesempeñoSaturday, November 5, 2011
Saturday, November 5, 2011
Saturday, November 5, 2011
node.js 0.4 + express + yui + mustacheSaturday, November 5, 2011
Apache + PHP                             Node + Express + YUI + MustacheSaturday, November 5, 2011
Saturday, November 5, 2011
Apache + PHP no creceSaturday, November 5, 2011
Saturday, November 5, 2011
Thank you                             caridy@yahoo-inc.com                             @caridySaturday, November 5, 2011
Links            • nodejs.org            • npm.org            • expressjs.com            • yuilibrary.com/projects/nodejs-...
Más sobre Yahoo! Mojito:                             http://www.slideshare.net/rhyolight/mojito-sl-2011Saturday, November ...
Más sobre Yahoo! Manhattan:                  http://video.yahoo.com/yahoonet-24189541/yodel-24697328/                  coc...
Upcoming SlideShare
Loading in...5
×

Conquistando el Servidor con Node.JS

2,530

Published on

Published in: Technology
4 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total Views
2,530
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
33
Comments
4
Likes
1
Embeds 0
No embeds

No notes for slide

Conquistando el Servidor con Node.JS

  1. 1. Conquering the Server Side with Node.JS StartTechConf 2011 Caridy Patiño Search Direct Team YUI Evangelist YUI Contributor caridy@yahoo-inc.com @caridySaturday, November 5, 2011
  2. 2. Saturday, November 5, 2011
  3. 3. La industria esta cambiando muy rápidoSaturday, November 5, 2011
  4. 4. Chrome + V8Saturday, November 5, 2011
  5. 5. Internet de alta velocidadSaturday, November 5, 2011
  6. 6. Coulds / NubesSaturday, November 5, 2011
  7. 7. WebApps & AppsSaturday, November 5, 2011
  8. 8. Almazenamiento MásivoSaturday, November 5, 2011
  9. 9. La web en tiempo realSaturday, November 5, 2011
  10. 10. Y esto se traduce en...Saturday, November 5, 2011
  11. 11. Peaks / PicosSaturday, November 5, 2011
  12. 12. ConcurrenciaSaturday, November 5, 2011
  13. 13. ConcurrenciaSaturday, November 5, 2011
  14. 14. Saturday, November 5, 2011
  15. 15. ut O old S Microsoft VBScript compilation error ‘800a03e9′ Out of memory /LM/W3SVC/600510919/Root/dStore/http://global.asa, line 0Saturday, November 5, 2011
  16. 16. DesempeñoSaturday, November 5, 2011
  17. 17. Soluciones...Saturday, November 5, 2011
  18. 18. Más servidoresSaturday, November 5, 2011
  19. 19. Más servidores $$$$$Saturday, November 5, 2011
  20. 20. Nubes ElásticasSaturday, November 5, 2011
  21. 21. Wow Amazon EC2 Is Expensive For Start Ups “With EC2, I would pay 30 days * 24 hours * $0.1 * 1.19 (tax) = $85. And that does not take into account backup space (S3), traffic and true persistent storage (EBS) yet.”Saturday, November 5, 2011
  22. 22. Delegar procesos hacia el clienteSaturday, November 5, 2011
  23. 23. Saturday, November 5, 2011
  24. 24. Node.JSSaturday, November 5, 2011
  25. 25. Server Side JavaScript (SSJS)Saturday, November 5, 2011
  26. 26. NarwhalJS RingoJS Wakanda Rhino AkshellSaturday, November 5, 2011
  27. 27. Nuestros sistemas operativos y lenguajes derivan de los sistemas diseñados para teletipos.Saturday, November 5, 2011
  28. 28. Las plataformas modernas de software siguen imitando estas interfaces antiguas.Saturday, November 5, 2011
  29. 29. “Blocking system call” is a call into the kernel which waits for some I/O to complete before before returning. Blocking syscalls introduce unbounded latency into the current thread.Saturday, November 5, 2011
  30. 30. Los procesos son buenos para mantener unidades aisladas. Sin embargo, son demasiado pesados como para dedicarle una conexión completa.Saturday, November 5, 2011
  31. 31. Uno de los objetivos principales de Node es hacer accesible la programación sin bloqueo para aquellos usuario que no son expertos.Saturday, November 5, 2011
  32. 32. Node ha tenido éxito en poner servidor de alto desempeño al alcance de los programadores utilizando una API sin bloqueosSaturday, November 5, 2011
  33. 33. Un solo stack por cada procesoSaturday, November 5, 2011
  34. 34. Node.JS solo tiene 2.5 años de edad. La version 0.6 es la 3ra iteración estable.Saturday, November 5, 2011
  35. 35. Saturday, November 5, 2011
  36. 36. HTTP benchmark con 100 clientes concurrentes en OSX 10.6 - v0.2.6 5330 req/sec - v0.4.12 5552 req/sec - v0.5.10 5803 req/seSaturday, November 5, 2011
  37. 37. Por qué Javascript?Saturday, November 5, 2011
  38. 38. Javascript es el lenguaje del navegadorSaturday, November 5, 2011
  39. 39. Javascript es un lenguaje dinámicoSaturday, November 5, 2011
  40. 40. Closures y programación asincrónica por naturalezaSaturday, November 5, 2011
  41. 41. Comunidad creciente, activa y diversaSaturday, November 5, 2011
  42. 42. http://github.com/languagesSaturday, November 5, 2011
  43. 43. No existe otro lenguaje que pueda destronar a javascript en un future cercanoSaturday, November 5, 2011
  44. 44. Node Event LoopSaturday, November 5, 2011
  45. 45. var result = db.query("select * from T"); // use resultSaturday, November 5, 2011
  46. 46. var result = db.query("select * from T"); // use result Qué esta haciendo el software mientras se ejecuta la query?Saturday, November 5, 2011
  47. 47. db.query("select * from T", function (result) { // use result });Saturday, November 5, 2011
  48. 48. db.query("select * from T", function (result) { // use result }); Este código le permite al programa retornar al event loop inmediatamenteSaturday, November 5, 2011
  49. 49. Node maneja todas los IO de la misma maneraSaturday, November 5, 2011
  50. 50. Saturday, November 5, 2011
  51. 51. Menos memoria necesita ser usada, y un mayor rendimiento debido al menor número de cambios de contexto.Saturday, November 5, 2011
  52. 52. El uso de los closures para capturar el estado entre diferentes eventosSaturday, November 5, 2011
  53. 53. function adicionar(callback) { http.get(url1, function(respuesta1) { var parte1 = respuesta1.data; http.get(url2, function(respuesta2) { var parte2 = respuesta2.data; callback(parte1 + parte2); }); }); }Saturday, November 5, 2011
  54. 54. Node StackSaturday, November 5, 2011
  55. 55. Como usar NodeSaturday, November 5, 2011
  56. 56. Download, configure, compile, and make install it: http://nodejs.org/Saturday, November 5, 2011
  57. 57. Windows Build (Node v0.6.0): http://nodejs.org/dist/v0.6.0/node.exeSaturday, November 5, 2011
  58. 58. NPM http://npm.org/Saturday, November 5, 2011
  59. 59. curl http://npmjs.org/install.sh | shSaturday, November 5, 2011
  60. 60. NPM 101 $ npm help $ npm install <pkgName> $ npm uninstall <pkgName> $ npm publish $ npm list $ npm update http://howtonode.org/introduction-to-npmSaturday, November 5, 2011
  61. 61. $  npm  list app@0.1.0  /Users/caridy/node/app  connect@1.7.1      mime@1.2.4      qs@0.3.1    express@2.4.7      mime@1.2.4      mkdirp@0.0.7      qs@0.3.1    micro<me@0.1.3-­‐1    mime@1.2.4    yui3@0.7.4    htmlparser@1.7.3      yui3-­‐core@3.4.0      yuitest@0.6.9    yui3-­‐core@3.4.0Saturday, November 5, 2011
  62. 62. Express http://expressjs.com/Saturday, November 5, 2011
  63. 63. $ cd my/node/app/ $ npm install expressSaturday, November 5, 2011
  64. 64. Requiriendo Express NPM Module var app = require(express).createServer(); app.get(/usuario/:id, function(req, res){ res.send(Bienvenido + req.params.id); }); app.listen(3000);Saturday, November 5, 2011
  65. 65. $ node app.jsSaturday, November 5, 2011
  66. 66. http://localhost:3000/usuario/caridySaturday, November 5, 2011
  67. 67. Express Boilerplate $ npm install -g express $ cd my/node/app/ $ express ./ $ npm install -d $ node app.jsSaturday, November 5, 2011
  68. 68. YUISaturday, November 5, 2011
  69. 69. Saturday, November 5, 2011
  70. 70. $ npm install yui3Saturday, November 5, 2011
  71. 71. var YUI = require("yui3").YUI; Requiriendo YUI NPM Module YUI().use(json, io, function(Y) { Y.io(http://yuilibrary.com/gallery/api/user/caridy, { on: { success: function(id, o) { Y.log(Y.JSON.parse(o.responseText), info, demo); } } }); });Saturday, November 5, 2011
  72. 72. var YUI = require("yui3").YUI; Requiriendo YUI NPM Module YUI().use(yql, function(Y) { var query = select * from geo.states where place="Chile" and lang="es-CL" ; Y.YQL(query, function(result) { // =result= now contains the result of the YQL Query // use the YQL Developer console to learn // what data is coming back in this object // and how that data is structured. Y.log(result, info, demo); }); }); http://developer.yahoo.com/yql/console/#h=select%20*%20from%20geo.states%20where %20place%3D%22Chile%22%20and%20lang%3D%22es-CL%22Saturday, November 5, 2011
  73. 73. { "query": { "count": 15, "created": "2011-10-31T15:38:44Z", "results": { "place": [ { "lang": "es-CL", "uri": "http://where.yahooapis.com/v1/place/2345028", "woeid": "2345028", "placeTypeName": { "code": "8", "content": "Región" }, "name": "Maule" }, { "lang": "es-CL", "uri": "http://where.yahooapis.com/v1/place/2345025", "woeid": "2345025", "placeTypeName": { "code": "8", "content": "Región" }, "name": "Libertador General Bernardo OHiggins" }, { "lang": "es-CL", "uri": "http://where.yahooapis.com/v1/place/2345029", "woeid": "2345029", "placeTypeName": { "code": "8", "content": "Región" }, "name": "Santiago" } ] } } }Saturday, November 5, 2011
  74. 74. YUI Library Who contributes? Everyone, with committer review. YUI Gallery Who contributes? Everyone, with little review. YUI Test Comprehensive unit testing solution for any JS code YETI YUI Easy Testing Interface: run browser JS unit tests from consoleSaturday, November 5, 2011
  75. 75. Yahoo! CocktailsSaturday, November 5, 2011
  76. 76. Saturday, November 5, 2011
  77. 77. Cocktails: MojitoSaturday, November 5, 2011
  78. 78. Mojito es un Web Application FrameworkSaturday, November 5, 2011
  79. 79. Mojits MVC Controller Model ViewSaturday, November 5, 2011
  80. 80. Tres tipos de scripts: - foo.server.js - foo.common.js - foo.client.jsSaturday, November 5, 2011
  81. 81. Multiples Runtimes Javascript on the Native Bridges Javascript on the browser iOS Android serverSaturday, November 5, 2011
  82. 82. Mojito Command 101 $ mojito help $ mojito create app ./myApp $ mojito create mojit Foo $ mojito test $ mojito compile $ mojito startSaturday, November 5, 2011
  83. 83. Mojito Application Folder ./myApp - application.json - assets - autoload - index.js - mojits - Foo - Bar - package.json - server.jsSaturday, November 5, 2011
  84. 84. Open Source a inicios del 2012Saturday, November 5, 2011
  85. 85. Cocktails: ManhattanSaturday, November 5, 2011
  86. 86. Yahoo! Manhattan es un ambiente de hosting para aplicaciones basadas en Mojito que utiliza la nube de Yahoo! para correr esas aplicaciones.Saturday, November 5, 2011
  87. 87. Server Side: Technology Stack Mojito App Mojito YUI Express Mustache Connect Cocktails Abstractions Node.JS V8 Manhattan Security Filters Tracking MonitoringSaturday, November 5, 2011
  88. 88. Yahoo! Manhattan extiende Node.JS para proveer fault- isolation & fault-tolerance, escalabilidad, disponibilidad, seguridad y desempeño.Saturday, November 5, 2011
  89. 89. Saturday, November 5, 2011
  90. 90. Manhattan provides a simple interface for developers to deploy, un-deploy and manage their Mojito-based applications, leveraging the scale and performance of Yahoo!’s technology infrastructure.Saturday, November 5, 2011
  91. 91. DesempeñoSaturday, November 5, 2011
  92. 92. Saturday, November 5, 2011
  93. 93. Saturday, November 5, 2011
  94. 94. node.js 0.4 + express + yui + mustacheSaturday, November 5, 2011
  95. 95. Apache + PHP Node + Express + YUI + MustacheSaturday, November 5, 2011
  96. 96. Saturday, November 5, 2011
  97. 97. Apache + PHP no creceSaturday, November 5, 2011
  98. 98. Saturday, November 5, 2011
  99. 99. Thank you caridy@yahoo-inc.com @caridySaturday, November 5, 2011
  100. 100. Links • nodejs.org • npm.org • expressjs.com • yuilibrary.com/projects/nodejs-yui3/Saturday, November 5, 2011
  101. 101. Más sobre Yahoo! Mojito: http://www.slideshare.net/rhyolight/mojito-sl-2011Saturday, November 5, 2011
  102. 102. Más sobre Yahoo! Manhattan: http://video.yahoo.com/yahoonet-24189541/yodel-24697328/ cocktails-in-action-27127763.html http://video.yahoo.com/yahoonet-24189541/yodel-24697328/ introducing-cocktails-from-yahoo-27127762.htmlSaturday, November 5, 2011
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×