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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
スキルを作る、その前に!複数人で使われるスキルを 作るためのプロセス
junkifurukawa
1
160
VS Code × GitHub Copilot での Fabric 開発
ryomaru0825
1
210
1人アドミンな私はAWSアカウント申請をSlackで完結したい!
ysuzuki
0
110
Databricksメトリクスビューはじめてのもくもく会
taka_aki
0
150
SQL Server 2025 最適化されたロック
odashinsuke
0
120
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
1
170
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
leveragestech
PRO
0
130
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
160
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
220
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
850
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
220
TiDBファミリーにDWHが新登場!! TiDB最新情報 / TiDB update 202609
yoshiakiyamasaki
0
180
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
260
Abbi's Birthday
coloredviolet
4
10k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
690
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Being A Developer After 40
akosma
91
590k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
A Tale of Four Properties
chriscoyier
163
24k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Building an army of robots
kneath
307
47k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
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!