Download - Node map keynote -FOSS4G Osaka
“Node.js-Engined”open source map service
- Node.js로 구현한 Open Source 맵 서비스
Doh Kyoung Tae
12년 11월 27일 화
What? Node.js?
Why Node.js?
Yes! Node.js
NodeMap!
Benchmark Test
TOC
12년 11월 27일 화
What? Node.js?
12년 11월 27일 화
What? Node.js?Server-Side Javascript
12년 11월 27일 화
What? Node.js?Server-Side JavascriptMade by V8 Engine(= Chrome Javascript Engine)
12년 11월 27일 화
What? Node.js?Server-Side JavascriptMade by V8 Engine(= Chrome Javascript Engine)
vs Rhino, SpiderMonkey
12년 11월 27일 화
What? Node.js?Server-Side JavascriptMade by V8 Engine(= Chrome Javascript Engine)
vs Rhino, SpiderMonkey
Common JS Spec.
12년 11월 27일 화
What? Node.js?Server-Side JavascriptMade 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 JavascriptMade 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.js1. Event Loop
Apache Uses one thread/connectionNginx doesn’t use threadIt uses event Loop
thread vs event loop
12년 11월 27일 화
Why? Node.js1. Event Loop
Apache Uses one thread/connectionNginx doesn’t use threadIt uses event Loop
thread vs event loop
12년 11월 27일 화
Why? Node.js2.Non-block I/O
http://www.ibm.com/developerworks/linux/library/l-async/
vs
synchronous block IO asynchronous non-block IO
12년 11월 27일 화
Why? Node.js2.Non-block I/O
http://www.ibm.com/developerworks/linux/library/l-async/
vs
synchronous block IO asynchronous non-block IO
12년 11월 27일 화
Why? Node.js2.Non-block I/O
http://www.ibm.com/developerworks/linux/library/l-async/
vs
synchronous block IO asynchronous non-block IO
12년 11월 27일 화
Why? Node.js2.Non-block I/O
Blocking code
12년 11월 27일 화
Why? Node.js2.Non-block I/O
Blocking code
Non - blocking code
12년 11월 27일 화
Why? Node.js2.Non-block I/O
Blocking code
Non - blocking code
12년 11월 27일 화
Yes! Node.js
12년 11월 27일 화
Yes! Node.jsModules
exports.defineFunction = function(){ …….}
var usingFunction = require(‘ModuleA’).defineFunction;
java - mavenLinux - rpmhomebrew - brew
node.js - npm/Users/dev/node.js> npm install.....
12년 11월 27일 화
Yes! Node.jsNVM - Node.js Version Manager
Preventing headachefrom Dependency Hell.
12년 11월 27일 화
Yes! Node.jsNVM - Node.js Version Manager
Preventing headachefrom Dependency Hell.
真っ白に燃え尽きたジョ〡は、どこか満足そうな顔をしている
12년 11월 27일 화
Node Map
• Image Service• Vector Service• Tile Making• Using Canvas - Image Effect
12년 11월 27일 화
Node Map1. DB Connector - pg /Users/dev/node.js> npm install pg
pg module
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()); ! }); });
12년 11월 27일 화
Node Map1. 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 Map2. 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 Map3. 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 - 20userA corp. – C Engine B corp. – JAVA Engine NodeMap
12년 11월 27일 화
Test - 20userA corp. – C Engine B corp. – JAVA Engine NodeMap
A product response time : AVG 770 msB product response time : AVG 1363 msNodeMap response time : AVG 536 ms
12년 11월 27일 화
Test - 50userA corp. – C Engine B corp. – JAVA Engine NodeMap
12년 11월 27일 화
Test - 50userA corp. – C Engine B corp. – JAVA Engine NodeMap
A product response time : AVG 1955msB product response time : AVG 20513 ms
NodeMap response time : AVG 1351ms
12년 11월 27일 화
Test - 100userA corp. – C Engine B corp. – JAVA Engine NodeMap
12년 11월 27일 화
Test - 100userA corp. – C Engine B corp. – JAVA Engine NodeMap
A product response time : AVG 3841msB product response time : AVG - ms
NodeMap response time : AVG 2635ms
12년 11월 27일 화
Insight from Test
VS
12년 11월 27일 화
Where? NodeMap!
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일 화