ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
¡°±·´Ç»å±ð.Âá²õ-·¡²Ô²µ¾±²Ô±ð»å¡±
                      open source map service

                            - Node.js? ??? Open Source ? ???



                                                 Doh Kyoung Tae




12?	 11?	 27?	 ?
TOC

                   What? Node.js?

                   Why Node.js?

                   Yes! Node.js

                   NodeMap!

                   Benchmark Test




12?	 11?	 27?	 ?
What? Node.js?




12?	 11?	 27?	 ?
What? Node.js?
                            Server-Side Javascript




12?	 11?	 27?	 ?
What? Node.js?
                            Server-Side Javascript
                            Made by V8 Engine
                            (= Chrome Javascript Engine)




12?	 11?	 27?	 ?
What? Node.js?
                            Server-Side Javascript
                            Made by V8 Engine
                            (= Chrome Javascript Engine)
                                 vs Rhino, SpiderMonkey




12?	 11?	 27?	 ?
What? Node.js?
                            Server-Side Javascript
                            Made by V8 Engine
                            (= Chrome Javascript Engine)
                                 vs Rhino, SpiderMonkey


                            Common JS Spec.




12?	 11?	 27?	 ?
What? Node.js?
                            Server-Side Javascript
                            Made by V8 Engine
                            (= Chrome Javascript Engine)
                                 vs Rhino, SpiderMonkey


                            Common JS Spec.
                                 Modules 1.0 spec draft




12?	 11?	 27?	 ?
What? Node.js?
                            Server-Side Javascript
                            Made by V8 Engine
                            (= Chrome Javascript Engine)
                                 vs Rhino, SpiderMonkey


                            Common JS Spec.
                                 Modules 1.0 spec draft

                            company, community, developer




12?	 11?	 27?	 ?
Why? Node.js


                         ??




12?	 11?	 27?	 ?
Why? Node.js
     1. Event Loop
         Apache Uses one thread/connection
         Nginx doesn¡¯t use thread
         It uses event Loop


                                             thread vs event loop




12?	 11?	 27?	 ?
Why? Node.js
     1. Event Loop
         Apache Uses one thread/connection
         Nginx doesn¡¯t use thread
         It uses event Loop


                                             thread vs event loop




12?	 11?	 27?	 ?
Why? Node.js
     2.Non-block I/O

                           synchronous block IO              asynchronous non-block IO




                                                  vs




                   http://www.ibm.com/developerworks/linux/library/l-async/

12?	 11?	 27?	 ?
Why? Node.js
     2.Non-block I/O

                           synchronous block IO              asynchronous non-block IO




                                                  vs




                   http://www.ibm.com/developerworks/linux/library/l-async/

12?	 11?	 27?	 ?
Why? Node.js
     2.Non-block I/O

                           synchronous block IO              asynchronous non-block IO




                                                  vs




                   http://www.ibm.com/developerworks/linux/library/l-async/

12?	 11?	 27?	 ?
Why? Node.js
    2.Non-block I/O


          Blocking code




12?	 11?	 27?	 ?
Why? Node.js
    2.Non-block I/O


          Blocking code




          Non - blocking code




12?	 11?	 27?	 ?
Why? Node.js
    2.Non-block I/O


          Blocking code




          Non - blocking code




12?	 11?	 27?	 ?
Yes! Node.js



12?	 11?	 27?	 ?
Yes! Node.js
    Modules
                                                    java - maven
  /Users/dev/node.js> npm install                   Linux - rpm
                                    node.js - npm
  .....
                                                    homebrew - brew
  exports
  .defineFunction = function(){
          ¡­¡­.
  }

  var usingFunction =
  require(¡®ModuleA¡¯)
  .defineFunction;




12?	 11?	 27?	 ?
Yes! Node.js
    NVM - Node.js Version Manager




                                    Preventing headache
                                    from Dependency Hell.




12?	 11?	 27?	 ?
Yes! Node.js
    NVM - Node.js Version Manager   Õæ¤Ã°×¤Ëȼ¤¨¾¡¤­¤¿¥¸¥ç©`¤Ï¡¢¤É¤³¤«œº×㤽¤¦
                                    ¤Êò¤·¤Æ¤¤¤ë



                                         Preventing headache
                                         from Dependency Hell.




12?	 11?	 27?	 ?
Node Map




                   ?   Image Service
                   ?   Vector Service
                   ?   Tile Making
                   ?   Using Canvas - Image Effect
12?	 11?	 27?	 ?
Node Map
    1. DB Connector - pg                                           /Users/dev/node.js> npm install pg

              pg.connect(conString, function(err, client) {
              !      client.query("SELECT NOW() as when", function(err, result) {
              !      !     console.log("Row count: %d",result.rows.length); / 1
                                                                             /
              !      !     console.log("Current year: %d", result.rows[0].when.getYear());
              !      });
                   });




                                                         pg module



12?	 11?	 27?	 ?
Node Map
    1. pg - Why not mongo?



                             ?   Poor Spatial Index
                                 - Just Point support
                             ?   Post GIS Limitation
                                 - Block I/O
                                 - So, DB can be bottle neck




                             ?   Alternative Way
                                 - couch DB

12?	 11?	 27?	 ?
Node Map
    2. Web module - express   /Users/dev/node.js> npm install express




                                        ?   MVC Web Framework
                                             - jade support
                                             - like spring in java
                                        ?   Always Top Module
                                             - npm registry




12?	 11?	 27?	 ?
Node Map
    3. Image Processing - Node-Canvas    /Users/dev/node.js> npm install canvas




                                        var Canvas = require('canvas')
                                          , canvas = new Canvas(200,200)
                                          , ctx = canvas.getContext('2d');
                                        ctx.beginPath();
                                        ctx.lineTo(50, 102);
                                        ctx.lineTo(50 + te.width, 102);
                                        ctx.stroke();




12?	 11?	 27?	 ?
At a glance




12?	 11?	 27?	 ?
At a glance




12?	 11?	 27?	 ?
Demo




12?	 11?	 27?	 ?
Test - 20user
                   A corp. ¨C C Engine   B corp. ¨C JAVA Engine   NodeMap




12?	 11?	 27?	 ?
Test - 20user
                   A corp. ¨C C Engine         B corp. ¨C JAVA Engine             NodeMap




                                        A product response time : AVG 770 ms
                                        B product response time : AVG 1363 ms
                                        NodeMap response time : AVG 536 ms




12?	 11?	 27?	 ?
Test - 50user
                   A corp. ¨C C Engine   B corp. ¨C JAVA Engine   NodeMap




12?	 11?	 27?	 ?
Test - 50user
                   A corp. ¨C C Engine         B corp. ¨C JAVA Engine              NodeMap




                                         A product response time : AVG 1955ms
                                        B product response time : AVG 20513 ms
                                         NodeMap response time : AVG 1351ms




12?	 11?	 27?	 ?
Test - 100user
                   A corp. ¨C C Engine   B corp. ¨C JAVA Engine   NodeMap




12?	 11?	 27?	 ?
Test - 100user
                   A corp. ¨C C Engine        B corp. ¨C JAVA Engine             NodeMap




                                        A product response time : AVG 3841ms
                                         B product response time : AVG - ms
                                        NodeMap response time : AVG 2635ms




12?	 11?	 27?	 ?
Insight from Test


                          VS




12?	 11?	 27?	 ?
Where? NodeMap!
                                       @iam_keen
                                       ehrudxo@gmail.com




                   https://github.com/ehrudxo/nodeMap


12?	 11?	 27?	 ?
Beyond the border




                     Between Client & Server language


12?	 11?	 27?	 ?
Thank You!
                      ?   Q&A




12?	 11?	 27?	 ?

More Related Content

Node map keynote -FOSS4G Osaka

  • 1. ¡°±·´Ç»å±ð.Âá²õ-·¡²Ô²µ¾±²Ô±ð»å¡± open source map service - Node.js? ??? Open Source ? ??? Doh Kyoung Tae 12? 11? 27? ?
  • 2. TOC What? Node.js? Why Node.js? Yes! Node.js NodeMap! Benchmark Test 12? 11? 27? ?
  • 4. What? Node.js? Server-Side Javascript 12? 11? 27? ?
  • 5. What? Node.js? Server-Side Javascript Made by V8 Engine (= Chrome Javascript Engine) 12? 11? 27? ?
  • 6. What? Node.js? Server-Side Javascript Made by V8 Engine (= Chrome Javascript Engine) vs Rhino, SpiderMonkey 12? 11? 27? ?
  • 7. What? Node.js? Server-Side Javascript Made by V8 Engine (= Chrome Javascript Engine) vs Rhino, SpiderMonkey Common JS Spec. 12? 11? 27? ?
  • 8. What? Node.js? Server-Side Javascript Made by V8 Engine (= Chrome Javascript Engine) vs Rhino, SpiderMonkey Common JS Spec. Modules 1.0 spec draft 12? 11? 27? ?
  • 9. What? Node.js? Server-Side Javascript Made by V8 Engine (= Chrome Javascript Engine) vs Rhino, SpiderMonkey Common JS Spec. Modules 1.0 spec draft company, community, developer 12? 11? 27? ?
  • 10. Why? Node.js ?? 12? 11? 27? ?
  • 11. Why? Node.js 1. Event Loop Apache Uses one thread/connection Nginx doesn¡¯t use thread It uses event Loop thread vs event loop 12? 11? 27? ?
  • 12. Why? Node.js 1. Event Loop Apache Uses one thread/connection Nginx doesn¡¯t use thread It uses event Loop thread vs event loop 12? 11? 27? ?
  • 13. Why? Node.js 2.Non-block I/O synchronous block IO asynchronous non-block IO vs http://www.ibm.com/developerworks/linux/library/l-async/ 12? 11? 27? ?
  • 14. Why? Node.js 2.Non-block I/O synchronous block IO asynchronous non-block IO vs http://www.ibm.com/developerworks/linux/library/l-async/ 12? 11? 27? ?
  • 15. Why? Node.js 2.Non-block I/O synchronous block IO asynchronous non-block IO vs http://www.ibm.com/developerworks/linux/library/l-async/ 12? 11? 27? ?
  • 16. Why? Node.js 2.Non-block I/O Blocking code 12? 11? 27? ?
  • 17. Why? Node.js 2.Non-block I/O Blocking code Non - blocking code 12? 11? 27? ?
  • 18. Why? Node.js 2.Non-block I/O Blocking code Non - blocking code 12? 11? 27? ?
  • 20. Yes! Node.js Modules java - maven /Users/dev/node.js> npm install Linux - rpm node.js - npm ..... homebrew - brew exports .defineFunction = function(){ ¡­¡­. } var usingFunction = require(¡®ModuleA¡¯) .defineFunction; 12? 11? 27? ?
  • 21. Yes! Node.js NVM - Node.js Version Manager Preventing headache from Dependency Hell. 12? 11? 27? ?
  • 22. Yes! Node.js NVM - Node.js Version Manager Õæ¤Ã°×¤Ëȼ¤¨¾¡¤­¤¿¥¸¥ç©`¤Ï¡¢¤É¤³¤«œº×㤽¤¦ ¤Êò¤·¤Æ¤¤¤ë Preventing headache from Dependency Hell. 12? 11? 27? ?
  • 23. Node Map ? Image Service ? Vector Service ? Tile Making ? Using Canvas - Image Effect 12? 11? 27? ?
  • 24. Node Map 1. DB Connector - pg /Users/dev/node.js> npm install pg pg.connect(conString, function(err, client) { ! client.query("SELECT NOW() as when", function(err, result) { ! ! console.log("Row count: %d",result.rows.length); / 1 / ! ! console.log("Current year: %d", result.rows[0].when.getYear()); ! }); }); pg module 12? 11? 27? ?
  • 25. Node Map 1. pg - Why not mongo? ? Poor Spatial Index - Just Point support ? Post GIS Limitation - Block I/O - So, DB can be bottle neck ? Alternative Way - couch DB 12? 11? 27? ?
  • 26. Node Map 2. Web module - express /Users/dev/node.js> npm install express ? MVC Web Framework - jade support - like spring in java ? Always Top Module - npm registry 12? 11? 27? ?
  • 27. Node Map 3. Image Processing - Node-Canvas /Users/dev/node.js> npm install canvas var Canvas = require('canvas') , canvas = new Canvas(200,200) , ctx = canvas.getContext('2d'); ctx.beginPath(); ctx.lineTo(50, 102); ctx.lineTo(50 + te.width, 102); ctx.stroke(); 12? 11? 27? ?
  • 28. At a glance 12? 11? 27? ?
  • 29. At a glance 12? 11? 27? ?
  • 31. Test - 20user A corp. ¨C C Engine B corp. ¨C JAVA Engine NodeMap 12? 11? 27? ?
  • 32. Test - 20user A corp. ¨C C Engine B corp. ¨C JAVA Engine NodeMap A product response time : AVG 770 ms B product response time : AVG 1363 ms NodeMap response time : AVG 536 ms 12? 11? 27? ?
  • 33. Test - 50user A corp. ¨C C Engine B corp. ¨C JAVA Engine NodeMap 12? 11? 27? ?
  • 34. Test - 50user A corp. ¨C C Engine B corp. ¨C JAVA Engine NodeMap A product response time : AVG 1955ms B product response time : AVG 20513 ms NodeMap response time : AVG 1351ms 12? 11? 27? ?
  • 35. Test - 100user A corp. ¨C C Engine B corp. ¨C JAVA Engine NodeMap 12? 11? 27? ?
  • 36. Test - 100user A corp. ¨C C Engine B corp. ¨C JAVA Engine NodeMap A product response time : AVG 3841ms B product response time : AVG - ms NodeMap response time : AVG 2635ms 12? 11? 27? ?
  • 37. Insight from Test VS 12? 11? 27? ?
  • 38. Where? NodeMap! @iam_keen ehrudxo@gmail.com https://github.com/ehrudxo/nodeMap 12? 11? 27? ?
  • 39. Beyond the border Between Client & Server language 12? 11? 27? ?
  • 40. Thank You! ? Q&A 12? 11? 27? ?