SlideShare a Scribd company logo
1 of 56
#JCConf
Dropwizard
-微服務架構框架-
anthonychen
#JCConf
About anthonychen
Github: https://github.com/anthonych
Blog: http://blog.anthonychen.idv.tw
Twitter: https://twitter.com/anthonychen
#JCConf
Agenda
• Dropwizard Introduction
• Microservice Architecture
• Why Dropwizard
• How to Dropwizard
• More Dropwizard
有一天…
於是...
本來我以為是...
結果其實是...
其實我需要的只是...
發現 Dropwizard!
2011.12 Opened by Yammer
Drop...wizard?
http://gunshowcomic.com/316
mustache
Dropwizard 包括...
Microservice Framework
dropwizard-assets dropwizard-jackson dropwizard-migrations
dropwizard-auth dropwizard-jdbi dropwizard-servlets
dropwizard-client dropwizard-jersey dropwizard-spdy
dropwizard-configuration dropwizard-jetty dropwizard-testing
dropwizard-core dropwizard-lifecycle dropwizard-util
dropwizard-db dropwizard-logging dropwizard-validation
dropwizard-example dropwizard-metrics-ganglial dropwizard-views-freemarker
dropwizard-forms dropwizard-metrics-graphite dropwizard-views-mustache
dropwizard-hibernate dropwizard-metrics dropwizard-views
Dropwizard Modules (v0.7.1)
Microservice Architecture
The microservice architectural style is an approach to developing
a single application as a suite of small services, each running in
its own process and communicating with lightweight
mechanisms, often an HTTP resource API. These services are
built around business capabilities and independently deployable
by fully automated deployment machinery.
- Martin Fowler
http://martinfowler.com/articles/microservices.html
http://martinfowler.com/articles/microservices.html
pid 1234 8GB heap
Monolithic Micro Services
pid 5978
2GB heap
pid 1234
2GB heap
pid 5678
2GB heap
pid 9527
2GB heap
Architecture
Monolithic Micro Services
Scalability
P
R
O
X
Y
Extensibility
Project Management
Microservice vs. SOA...
VS.
SleepyA RESTful framework for Go
Microservice Frameworks
Why
DropWizard?
http://www.oracle.com/us/technologies/java/gimmejava/usage-terms/index.html
開發效率
容易佈署
Single JAR
Self-Contained
http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=json&f=311c-1hq8-0-0
http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=db&f=311c-1hq8-0-0
http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=query&f=311c-1hq8-0-0
How to
DropWizard?
自 Dropwizard 0.7版開始,Service 類別改名為 Application
開發流程
Configuration
• YAML 設定檔
• Configuration 類別
Domain
• JDBI, Hibernate
• POJO 類別
• 可以是 hibernate entity
Resource
• Jersey controller 類別
• RESTful API 方法
Health Check
• 自訂 Healcheck 類別
• Freemarker, Mustache
Application
• 程式啟動點
• 設定 Resource, Healcheck...
Configuration Domain/DAOs Resource
Healthcheck/View Application
Build & Run
project-api: API 格式類別,通常是 JSON
project-client: API 的 HTTP客戶端程式
project-application: 應用程式實作
模組架構
com.example.myapplication:
api: API 格式類別實作
cli: Command 類別
client: HTTP 客戶端實作
core: Domain 類別實作
jdbi: JDBI 資料庫存取相關實作
health: Health Check 類別實作
resources: Resource 類別實作
Dropwizard 專案結構
server:
type:simple
applicationContextPath:/application
adminContextPath:/admin
database:
driverClass:com.mysql.jdbc.Driver
user:anthonychen
password:anthonychen
url:jdbc:mysql://localhost:3306/demo
Configuration Reference: http://dropwizard.io/manual/configuration.html
Configuration 檔案 (YAML)
public class BlogConfiguration extends Configuration {
@Valid
@NotNull
@JsonProperty("database")
private DataSourceFactory database = new DataSourceFactory();
public DataSourceFactory getDatabase() {
return database;
}}
Configuration 類別
public class DatabaseHealthCheck extends HealthCheck {
private final Database database;
public DatabaseHealthCheck(Database database) {
this.database = database;
}
@Override
protected Result check() throws Exception {
if (database.isConnected()) {
return Result.healthy();
} else {
return Result.unhealthy("Cannot connect to " + database.getUrl());
}
}}
Health Check 類別
ViewBundle
AssetsBundle
HibernateBundle,
ScanningHibernateBundle
MigrationsBundle
客製自己的Bundle – 實作ConfiguredBundle 介面
Bundle 類別
public class BlogApplication extends Application<BlogConfiguration> {
public static void main(String[] args) throws Exception {
new BlogApplication().run(args);
}
@Override
public void initialize(Bootstrap<BlogConfiguration> bootstrap) {
bootstrap.addBundle(hibernateBundle);
bootstrap.addBundle(new ViewBundle());
bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
}}
註冊 Bundles
Application 類別 – initialize( )
@Override
public void run(BlogConfiguration configuration, Environment environment) throws Exception {
// Crete DAOs
final ArticleDAO articleDAO = new ArticleDAO(hibernateBundle.getSessionFactory());
final UserDAO userDAO = new UserDAO(hibernateBundle.getSessionFactory());
// Create healthchecks
final SessionFactoryHealthCheck dbHealthCheck = new SessionFactoryHealthCheck(
hibernateBundle.getSessionFactory(),
configuration.getDatabase().getValidationQuery()
);
// Register resources, filters and healthchecks
environment.jersey().register(new BlogResource(configuration.getSiteName(), articleDAO));
environment.jersey().register(new ArticleResource(articleDAO, userDAO));
environment.healthChecks().register("databaseHealthcheck", dbHealthCheck);
}}
註冊 Resources,
HealthChecks...
Application 類別 – run( )
可使用 maven-shade 或 maven-assembly-plugin
包成 Fat JAR 檔案
命令列執行
java -jar [your_jar_file] server [your_yaml_file]
Ex. java –jar demo-0.0.1-SNAPSHOT.jar server demo.yaml
瀏覽器開啟 http://localhost:8080 即可開始使用應用程式
Build & Run
Demo
- A simple restful service -
Freemarker (http://freemarker.org)
Mustache (http://mustache.github.io)
另類作法:AssetsBundle + JavaScript MVC
View Layer
Demo
- A simple web application -
More
DropWizard?
Fallwizard (https://github.com/Berico-Technologies/Fallwizard)
dropwizard-springbundle:
(https://github.com/anthonych/Dropwizard-SpringBundle)
Dropwizard + Spring
https://github.com/rayokota/generator-angular-dropwizard
手工製作 AngularJS 程式 (使用 AssetsBundle)
使用 Yeoman + Angular-Dropwizard generator
或
Dropwizard + AngularJS
Yeoman + Angular-Dropwizard Generator
yo angular-dropwizard
命令列建立 Dropwizard 專案初步結構
yo angular-dropwizard:entity [your_entity_class_name]
Ex. yo angular-dropwizard:entity User
建立 Entity類別 (自動產生DAO、Resource 等類別)
grunt server
mvn exec:exec –pl [your_app-name]-service
Ex. mvn exec:exec –pl demo-service
mvn compile
編譯並執行 Service
執行 AngularJS 網頁應用程式
最後...
Dropwizard 適合...
http://www.flickr.com/photos/psd/13109673843 by Paul Downey
大型應用也可以...
Dropwizard 不是...
Dropwizard 也許只是...
一不小心...
別忘了他還是...
也許有一天...
Thank You!

More Related Content

What's hot

Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page AppsZachary Klein
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internalscarlo-rtr
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureZachary Klein
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
Spring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuSpring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuVMware Tanzu
 
jclouds overview
jclouds overviewjclouds overview
jclouds overviewAdrian Cole
 
AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)Nitya Narasimhan
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejugrobbiev
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best PracticesBurt Beckwith
 
Developing Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsDeveloping Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsGR8Conf
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
 
Reactive Microservice And Spring5
Reactive Microservice And Spring5Reactive Microservice And Spring5
Reactive Microservice And Spring5Jay Lee
 
Advanced Cojure Microservices
Advanced Cojure MicroservicesAdvanced Cojure Microservices
Advanced Cojure Microservicesinovex GmbH
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)Hendrik Ebbers
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "FDConf
 

What's hot (20)

Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internals
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Springを用いた社内ライブラリ開発
Springを用いた社内ライブラリ開発Springを用いた社内ライブラリ開発
Springを用いた社内ライブラリ開発
 
Spring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuSpring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFu
 
jclouds overview
jclouds overviewjclouds overview
jclouds overview
 
AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best Practices
 
Micronaut Launchpad
Micronaut LaunchpadMicronaut Launchpad
Micronaut Launchpad
 
Developing Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsDeveloping Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with Grails
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
 
Reactive Microservice And Spring5
Reactive Microservice And Spring5Reactive Microservice And Spring5
Reactive Microservice And Spring5
 
Advanced Cojure Microservices
Advanced Cojure MicroservicesAdvanced Cojure Microservices
Advanced Cojure Microservices
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "
 

Viewers also liked

ContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices HeroContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices HeroDragos Dascalita
 
Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...Balanced Team
 
Disruptors Don't Play By The Rules
Disruptors Don't Play By The RulesDisruptors Don't Play By The Rules
Disruptors Don't Play By The RulesReuven Gorsht
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring applicationJimmy Lu
 
No Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueNo Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueAndrus Adamchik
 
CF Korea Meetup - Spring Cloud Services
CF Korea Meetup - Spring Cloud ServicesCF Korea Meetup - Spring Cloud Services
CF Korea Meetup - Spring Cloud ServicesJay Lee
 
SpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
SpringCamp 2016 - Apache Geode 와 Spring Data GemfireSpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
SpringCamp 2016 - Apache Geode 와 Spring Data GemfireJay Lee
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice frameworkFabrice Sznajderman
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 

Viewers also liked (9)

ContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices HeroContainerCon 2015 - Be a Microservices Hero
ContainerCon 2015 - Be a Microservices Hero
 
Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...
 
Disruptors Don't Play By The Rules
Disruptors Don't Play By The RulesDisruptors Don't Play By The Rules
Disruptors Don't Play By The Rules
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 
No Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueNo Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with Bootique
 
CF Korea Meetup - Spring Cloud Services
CF Korea Meetup - Spring Cloud ServicesCF Korea Meetup - Spring Cloud Services
CF Korea Meetup - Spring Cloud Services
 
SpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
SpringCamp 2016 - Apache Geode 와 Spring Data GemfireSpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
SpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice framework
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 

Similar to Dropwizard - 微服務框架 Dropwizard 介紹

[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Creating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on HerokuCreating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on HerokuJoe Kutner
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...DataLeader.io
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For ManagersAgileThought
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCaelum
 
SBA Live Academy: A Primer in Single Page Application Security by Thomas Konrad
SBA Live Academy: A Primer in Single Page Application Security by Thomas KonradSBA Live Academy: A Primer in Single Page Application Security by Thomas Konrad
SBA Live Academy: A Primer in Single Page Application Security by Thomas KonradSBA Research
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJoshua Long
 
20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-finalDavid Lapsley
 
Gretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with GradleGretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with GradleAndrey Hihlovsky
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityWashington Botelho
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformWSO2
 
Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18Tabăra de Testare
 
Slaying Sacred Cows: Deconstructing Dependency Injection
Slaying Sacred Cows: Deconstructing Dependency InjectionSlaying Sacred Cows: Deconstructing Dependency Injection
Slaying Sacred Cows: Deconstructing Dependency InjectionTomer Gabel
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdevFrank Rousseau
 
Design systém 1.0
Design systém 1.0Design systém 1.0
Design systém 1.0Adam Kudrna
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 

Similar to Dropwizard - 微服務框架 Dropwizard 介紹 (20)

[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Creating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on HerokuCreating Scalable JVM/Java Apps on Heroku
Creating Scalable JVM/Java Apps on Heroku
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For Managers
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptor
 
SBA Live Academy: A Primer in Single Page Application Security by Thomas Konrad
SBA Live Academy: A Primer in Single Page Application Security by Thomas KonradSBA Live Academy: A Primer in Single Page Application Security by Thomas Konrad
SBA Live Academy: A Primer in Single Page Application Security by Thomas Konrad
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
 
20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final
 
Gretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with GradleGretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with Gradle
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrity
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18
 
Slaying Sacred Cows: Deconstructing Dependency Injection
Slaying Sacred Cows: Deconstructing Dependency InjectionSlaying Sacred Cows: Deconstructing Dependency Injection
Slaying Sacred Cows: Deconstructing Dependency Injection
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 
Design systém 1.0
Design systém 1.0Design systém 1.0
Design systém 1.0
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 

Recently uploaded

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 

Recently uploaded (20)

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 

Dropwizard - 微服務框架 Dropwizard 介紹

Editor's Notes

  1. 其實只是要寫一個小型的系統,將網路爬來的資料呈現出來,並可以提供給其他應用程式或報表系統,所以就想說寫一個 restful 小系統,那就自己來寫吧。
  2. 既然要寫,而且是自己一個人寫,那當然就要選自己拿手的技術與框架,加上又有 restful 的需求,所以我以Spring為主,資料庫存取選用 JPA + Hibernate,網頁的部分就試試之前用過的 thymeleaf,然後 logger、security、server… 結果我花個一個禮拜的時間才搞定這樣一個服務,其中很大一部份時間是在搞定相關設定
  3. 結果,本來我以為我用了這些穩固且知名的框架,應該是一個很完美的系統,不論程式的架構或是未來的可維護性都應該很漂亮,結果…
  4. 當我半年後回來看這個系統,我發現就像這個房間一樣,為什麼? 因為當初疊床架屋用了很多框架,加上中間為了需求而做的客製,加了許多功能,慢慢的系統越來越混亂,而且一陣子沒碰這個系統後,很多設定或是程式碼都已經忘記了…
  5. 回頭想想,其實這個系統的初衷沒有那麼複雜,只是隨著需求慢慢變多,我把很多功能加到這個系統,慢慢地系統的定位變得不單純。其實,我需要的只是依照需求把一個大系統分成好幾個小系統,那程式就會簡單的多,也不一定需要這麼多框架…
  6. 就在這時候,無意中發現了 Dropwizard 這個框架,你可以看到他強調 Java、ops-friendly、高效能和 restful,於是我就改用 Dropwizard 試試看,沒想到兩天就可以搞定一個小系統,其中一半的時間是在想怎麼把網頁轉到 Freemarker 上。從此之後就像某位網友所說的,和 IntelliJ Idea 一樣,回不去了。
  7. Yammer 是一個 enterprise social network 公司,Dropwizard 是他們用來建立後台與管理介面的框架。於 2011年開放原始碼。
  8. Dropwizard 這個名字的由來
  9. Dropwizard 其實不是全新的框架,他只是整合了很多既有的技術與框架,簡化架構與設定,以提供單一restful服務為目標的整合型框架,這類框架我們稱之為 microservice framework
  10. 這是今年三月,Martin Fowler在他的部落格的一篇文章提到了 microservice 的概念,這也是目前對 microservice 論述最完整的一篇文章。
  11. 開發有效率: 學習曲線單一,架構簡單 設定集中,一個 yaml 檔搞定 開發人員集中在 restful service 設計,一次只做一件事
  12. Signle JAR = No WAR 部署簡單,不管是一般環境或是雲端環境 所謂的 Devops Friendly
  13. 內建 Jetty 無須 application server,有好有壞。好處是減少 application server 的管理維護成本,壞處是原本 application server 所提供的功能就要自己想辦法,像是 connection pool、logging、monitoring 等 內建了 metric 這個 monitoring 服務,需搭配 Ganglia 或是 Graphite 等 monitoring server。