Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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.2k
Other Decks in Technology
See All in Technology
リアーキテクチャ後の障害ゼロを目指したShadow Testingの取り組み
nihonbuson
PRO
1
180
Kiro Meetup #8 Kiro アップデート (2026/3/21〜2026/9/24)
katzueno
1
230
音声コミュニティを守るAI監視基盤_ 90%以上の入力削減を支えたServerless設計と運用判断
shuheioka123
0
110
ScotSecure West 2026 - Glasgow
raybugg
0
180
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
130
セルフサービスのオブザーバビリティ基盤をOpenTelemetryで作る / Building a Self-Service Observability Platform with OpenTelemetry
ymotongpoo
2
290
事業課題から技術的負債に向き合う
sansantech
PRO
2
2.4k
あけおめLINE 傾向とその対策
nasa9084
0
330
C#未経験の僕がAIに読めるコードを書かせるまで
maguroalternative
0
300
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
650
品質と信頼性を地続きにする
grimoh
2
1k
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
2
380
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Ruling the World: When Life Gets Gamed
codingconduct
0
360
Being A Developer After 40
akosma
91
590k
Code Reviewing Like a Champion
maltzj
528
40k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
Automating Front-end Workflow
addyosmani
1369
210k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
How to build a perfect <img>
jonoalderson
1
6k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Prompt Engineering for Job Search
mfonobong
0
460
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!