Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin + Java EE + MongoDBでサーバ組んで本番で動かしてみた
Search
Tomohiro Nakamura
November 09, 2017
Technology
2.1k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlin + Java EE + MongoDBでサーバ組んで本番で動かしてみた
Tomohiro Nakamura
November 09, 2017
More Decks by Tomohiro Nakamura
See All by Tomohiro Nakamura
ICOコンサルティング事業から得たトークンと全体アーキテクチャ設計方針の知見 @ blockchain.tokyo #2
tomohiron
7
25k
FinTechスタートアップAnyPayを支える開発 @ Venture Engineer Meetup #01 -Server Side Night-
tomohiron
2
1.1k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
190
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
470
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.8k
AI フレンドリーなエラー監視を TypeScript で実現する
shinyaigeek
2
260
さきさん文庫の書籍ができるまで
sakiengineer
0
370
JJUG CCC 2026 Spring AI時代の開発こそ標準化を武器に! ― 方式・プロセス・プラットフォームの標準化
s27watanabe
2
720
製造業のクラウド活用最適解〜AI,DXを加速するデータ基盤の作り方〜
hamadakoji
0
370
「気づいたら仕事が終わっている」バクラクAIエージェント本番運用の裏側 / layerx-bakuraku-aie2026
yuya4
18
10k
新規ゲーム開発におけるAI駆動開発のリアル
202409e2
0
2.5k
SIer20年! 培ったスキルがスタートアップで輝く時
shucho0103
0
350
Claude Codeを組織で使いこなす— サーバサイドAIエージェント運用の実践知
techtekt
PRO
0
200
ITエンジニアを取り巻く環境とキャリアパス / A career path for Japanese IT engineers
takatama
4
1.8k
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
350
Technical Leadership for Architectural Decision Making
baasie
3
400
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
ラッコキーワード サービス紹介資料
rakko
1
3.5M
Speed Design
sergeychernyshev
33
1.8k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
190
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
Designing for Performance
lara
611
70k
Transcript
CTO Tomohiro Nakamura ( @HAIL ) Kotlin + Java EE
+ MongoDBで サーバ組んで本番で動かしてみた 2017/11/9(Thu)
⾃紹介 AnyPay株式会社 CTO Tomohiro Nakamura ( @HAIL ) 2010年 早稲⽥⼤学⼤学院情報理⼯学専攻
2010年 Goldman Sachs 2012年 Electronic Arts (ex. Playfish) 2014年 Wekids Inc. 創業 2016年 AnyPay株式会社 CTOとして⼊社 Java育ち。 paymo招待コード: PNKYFNP CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved ࣗݾհ
悩んでいた
このままでは Railsの会社になってしまう……
そんな気分で過ごしていた夏 あるミートアップで 「サーバをKotlinで書こうかな と思ってる」 と⾔ったら反応が良かった
「今Kotlinで書いたら、⼀時期 のGoみたいに優秀な⼈が採れ るんです!」 というのを建前に、 CTO権限でKotlinを採⽤
やるからには攻める
build.gradle dependencies { compile “org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version” // 1.1.51 testCompile "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version” //
5.0.1 testRuntime "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version" testCompile 'org.jetbrains.spek:spek-api:1.1.5' testRuntime 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5' providedCompile 'javax:javaee-api:7.0' compile "org.glassfish.jersey.core:jersey-client:$jersey_version” // 2.25.1 compile "org.glassfish.jersey.containers:jersey-container-servlet-core:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version” // 2.9.1 compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" compile 'io.github.microutils:kotlin-logging:1.4.6' compile "org.slf4j:slf4j-jdk14:$slf4j_version” // 1.7.25 compile 'com.google.inject.extensions:guice-servlet:4.1.0' compile 'org.glassfish.hk2:guice-bridge:2.4.0' compile 'com.google.cloud:google-cloud-logging:1.6.0' compile 'org.litote.kmongo:kmongo:3.5.0' } https://gist.github.com/tomohiro-n/e2c24d9db64ea1fb878ab8caad1aa180 CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved
リリース時の構成 • Kotlin 1.1 (JVM target 1.8) • Java EE
7 • Jersey 2.25 • Google Guice 4.1 • Jackson 2.9 • Kotlin Logging 1.4 • Gradle 3.5 CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved
Kotlin未経験からかかった時間 • 攻めすぎた割には、他の仕事もしながら2週間でリリースまでいった • 困難もあったけど、基本的にはもうKotlinサーバサイドの情報はある CONFIDENTIAL : copyright © by
2017 AnyPay inc. all rights reserved
リリース後にMongoDBの採⽤を決定 Kotlinでやる上で⼤事なこと • まず「Kotlin {使うもの}」でググる • JavaでMongoDBが使えることはまあ⾃明だが、Kotlin で使いやすいようWrapしたものが出ることが割とある ほう…… CONFIDENTIAL
: copyright © by 2017 AnyPay inc. all rights reserved
KMongo http://litote.org/kmongo/ CONFIDENTIAL : copyright © by 2017 AnyPay inc.
all rights reserved
テストも美しく - Spek object DateTimeServiceSpec: Spek({ describe("DateTimeService") { val dateTimeService
= DateTimeService() on("isDateTimeFresh") { it("should be able to judge if the specified time is less than 10 second old") { val oldTime = OffsetDateTime.now().minusSeconds(11) assertFalse(dateTimeService.isDateTimeFresh(oldTime)) val freshTime = OffsetDateTime.now().minusSeconds(9) assertTrue(dateTimeService.isDateTimeFresh(freshTime)) } } } }) https://gist.github.com/tomohiro-n/c2a86ba8f1286513387ec35a4199e8a7 CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved
くやしかったこと 公式ドキュメントの序⽂ http://spekframework.org/docs/latest/ 「Kotlinの基礎が分かってて、RubyをやったことがあってRspecを知って いればすぐできちゃうから」 ⽪⾁にもAnyPayに⼊ってRailsをやり続けたことが⽣きた…… CONFIDENTIAL : copyright ©
by 2017 AnyPay inc. all rights reserved
というわけでまとめ • Kotlinでサーバはもう⼗分書ける • JavaやRubyやC#やSwiftなどなどのいいとこ取りをした⾔語 • Kotlin⽤のライブラリもググれば結構出る • テストも書きやすい CONFIDENTIAL
: copyright © by 2017 AnyPay inc. all rights reserved
でも 最近も悩んでる
⼀緒に書く⼈がいない…… (周りを押し切ってほぼ独断でKotlin で書いたため) (⾃業⾃得感やばい)
Kotlinでお⾦の扱いを便利にしたい⼈ JOIN US!