SlideShare a Scribd company logo
1 of 29
Download to read offline
vert.x로개발하기 -김요한
yohany@gmail.com
!
2013.03.11
ServerSideArchitectGroup
vert.x특징은?
하지만,
직접만들어봐야알지!
!
오늘중요한건,
개.발.해.보.기
justintimeprogramming
!
1. 지원되는module로staticwebserver실해하기
2. mongodb를활용한모듈개발하고모듈단위테스트하기
3. API서버모듈개발하고EventBus사용하기
4. script로모듈디플로이해서실행하기
5. auto-deploy로쉽게테스트하기
6. cluster설정하여구성하기
Asynchronous
Modularity
Polyglot
vert.x 의 특징 중 3가지만,
非同期(non-blocking)
8
threadsocket
JavaVM
threadsocket
threadsocket
threadsocket
Traditional
AP Server
Vert.x
threadsocket
JavaVM
socket
socket
socket
socket:thread = 1:1 socket:thread = N:1
EventDispatcher
Asynchronous
高効率(Efficiency)
9
socket
Vert.x Runtime(JVM)
socket
socket
socket
CPU
Core
CPU
Core
CPU
Core
CPU
Core
Event
Loop
(thread)
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
EventDispatcher
Verticle
Instances
Asynchronous
スケーラブル
10
socket
Vert.x Runtime(JVM)
socket
socket
socket
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
EventDispatcher
socket
Vert.x Runtime(JVM)
socket
socket
socket
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
EventDispatcher
socket
Vert.x Runtime(JVM)
socket
socket
socket
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
EventDispatcher
socket
Vert.x Runtime(JVM)
socket
socket
socket
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
Verticle
EventDispatcher
EventBus
(BasedonHazelcast)
Node#1 Node#2
Node#3
(*)デフォルトではイベントはnon-persistent
Asynchronous
http://www.slideshare.net/nobusue/gws-20131018-vertxhandson
Modularity
Modularity
ClassLoader
Main.class!
library1.jar!
library2.jar!
library3.jar
Modularity
ClassLoader ClassLoader ClassLoader
Module1.class!
library1.jar!
library2.jar
Module2.class!
library1.jar!
library2.jar
Module2.class!
library1.jar!
library2.jar
Module 1 Module 2 Module 3
EventBus (vert.x)
Polyglot
“ Components + Scripts = Applications ”	

see John Ousterhout, IEEE Computer, March ’98	

http://www.stanford.edu/~ouster/cgi-bin/papers/scripting.pdf
Java, Javascript, CoffeeScript, Ruby, Python or Groovy...
http://vertx.io/
http://www.techempower.com/benchmarks/
URL Shortener 만들기
긴 URL 에 대한 Key
Server
Verticle
Persister
Worker

Verticle
vert.x instance
EventBus
Starter
Verticle
Server
Verticle
Persister
Worker

Verticle
vert.x instance
EventBus
Starter
Verticle
Deploy script (javascript)"
- 필요한 Module 을 Deploy 해주는 역할"
- 서버 프로그램 로직은 없고, 설정값 셋팅과 모듈 실행을 명령하는 script
Server
Verticle
Persister
Worker

Verticle
vert.x instance
EventBus
Starter
Verticle
HTTP API Server"
- /url/ [LONG URL] : 긴 URL 을 받아서 Persister Worker 가 생성한 KEY 를 반환"
- / [KEY] : KEY 를 받아서 Persister Worker 에서 가져온 긴 URL 로 redirect
HTTP Request ( port : 8080 )
Server
Verticle
Persister
Worker

Verticle
vert.x instance
EventBus
Starter
Verticle
mongoDB Persister"
- create : mongodb 로 부터 sequence 를 가져와서 

bijective algorithm 으로 short key 생성하고 다시 mongodb 에 URL 정보 저장. "
- get : short Key 로 mongodb 로 부터 URL 가져오기.
port : 27017
Server
Verticle
Persister
Worker

Verticle
vert.x instance
EventBus
Starter
Verticle
[DB] url-shortener
[COLLECTION] seq [COLLECTION] urls
_id documents
“urlShortener” {“seq” : 2311}
_id documents
“Ad23f” {“url” : “http://examp. . . . . . “}
“Ad23g” {“url” : “http://examp. . . . . . “}
“Ad23h” {“url” : “http://examp. . . . . . “}
. . . . .
vert.x instance
EventBus
StarterVerticle
ServerVerticle
ServerVerticle
ServerVerticle
ServerVerticle
PersisterWorker

Verticle
PersisterWorker

Verticle
PersisterWorker

Verticle
PersisterWorker

Verticle
PersisterWorker

Verticle
EventBus
EventBus
sequence 로 short key 생성하기
encode(2147483647) -> cvuMLb	


decode(“cvuMLb”) -> 2147483647
[DB] url-shortener
[COLLECTION] seq [COLLECTION] urls
_id documents
“urlShortener” {“seq” : 2311230}
_id documents
“Ad23f” {“url” : “http://examp. . . . . . “}
“Ad23g” {“url” : “http://examp. . . . . . “}
“Ad23h” {“url” : “http://examp. . . . . . “}
. . . . .
create(long url)
get(key)
1. seq 에서 시퀀스를 가져오고 increment !"
2. bijective 로 시퀀스를 문자 키로 변환"
3. urls 에 URL 정보 저장
1. key 로 urls 에서 URL 찾아서 반환
2311231 -> Ad23h
준비
Spring Tool Suite™ http://spring.io/tools/sts
http://www.oracle.com/technetwork/java/javase/downloads/index.htmlJDK 7
http://www.mongodb.org/downloadsmongoDB
just in time programming
데모말고,라이브코딩
아키텍트가뭐라고생각하세요?

More Related Content

What's hot

Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsMarcus Frödin
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in JavaClément Escoffier
 
Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존동수 장
 
Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming  Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming Tom Croucher
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點William Yeh
 
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Ontico
 
Amazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionAmazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionRemotty
 
Web前端性能优化 2014
Web前端性能优化 2014Web前端性能优化 2014
Web前端性能优化 2014Yubei Li
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with ExamplesGabriele Lana
 
Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven ProgrammingKamal Hussain
 
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013Puppet
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on NetscalerMark Hillick
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS ExpressDavid Boyer
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with AnsibleIvan Serdyuk
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & ExpressChristian Joudrey
 

What's hot (20)

Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Java
 
Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존
 
Node js
Node jsNode js
Node js
 
Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming  Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming
 
Vagrant and CentOS 7
Vagrant and CentOS 7Vagrant and CentOS 7
Vagrant and CentOS 7
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
 
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Amazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionAmazon EC2 Container Service in Action
Amazon EC2 Container Service in Action
 
Web前端性能优化 2014
Web前端性能优化 2014Web前端性能优化 2014
Web前端性能优化 2014
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven Programming
 
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on Netscaler
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & Express
 
The SPDY Protocol
The SPDY ProtocolThe SPDY Protocol
The SPDY Protocol
 

Similar to vert.x 소개 및 개발 실습

Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTudor Barbu
 
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr TsapDive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr TsapProvectus
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka featuresGrzegorz Duda
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.jsAyush Mishra
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
 
Test Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTest Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTobias Trelle
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleThierry Wasylczenko
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile InfrastructuresAntons Kranga
 
Assurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkAssurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkGosuke Miyashita
 
Faster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzFaster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzJBug Italy
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsJack Franklin
 

Similar to vert.x 소개 및 개발 실습 (20)

Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
 
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr TsapDive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Test Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTest Automation for NoSQL Databases
Test Automation for NoSQL Databases
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
Assurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkAssurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring framework
 
Faster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzFaster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzz
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 

More from John Kim

How to build Design System?
How to build Design System?How to build Design System?
How to build Design System?John Kim
 
Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurationsJohn Kim
 
Play node conference
Play node conferencePlay node conference
Play node conferenceJohn Kim
 
플랫폼이란 무엇인가 (IoT Platform)
플랫폼이란 무엇인가 (IoT Platform)플랫폼이란 무엇인가 (IoT Platform)
플랫폼이란 무엇인가 (IoT Platform)John Kim
 
채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례John Kim
 
2015 AWS IoT HACK DAY
2015 AWS IoT HACK DAY2015 AWS IoT HACK DAY
2015 AWS IoT HACK DAYJohn Kim
 
NODE.JS 글로벌 기업 적용 사례 그리고, real-time 어플리케이션 개발하기
NODE.JS 글로벌 기업 적용 사례  그리고, real-time 어플리케이션 개발하기NODE.JS 글로벌 기업 적용 사례  그리고, real-time 어플리케이션 개발하기
NODE.JS 글로벌 기업 적용 사례 그리고, real-time 어플리케이션 개발하기John Kim
 
vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기John Kim
 

More from John Kim (8)

How to build Design System?
How to build Design System?How to build Design System?
How to build Design System?
 
Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurations
 
Play node conference
Play node conferencePlay node conference
Play node conference
 
플랫폼이란 무엇인가 (IoT Platform)
플랫폼이란 무엇인가 (IoT Platform)플랫폼이란 무엇인가 (IoT Platform)
플랫폼이란 무엇인가 (IoT Platform)
 
채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례
 
2015 AWS IoT HACK DAY
2015 AWS IoT HACK DAY2015 AWS IoT HACK DAY
2015 AWS IoT HACK DAY
 
NODE.JS 글로벌 기업 적용 사례 그리고, real-time 어플리케이션 개발하기
NODE.JS 글로벌 기업 적용 사례  그리고, real-time 어플리케이션 개발하기NODE.JS 글로벌 기업 적용 사례  그리고, real-time 어플리케이션 개발하기
NODE.JS 글로벌 기업 적용 사례 그리고, real-time 어플리케이션 개발하기
 
vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기
 

vert.x 소개 및 개발 실습