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
契約書画像からの情報抽出に特化した視覚接地モデルを育てる話
sansantech
PRO
1
150
Codex概要
ymiya55
0
440
メルペイ 会計システム概要と歴史
mewuto
0
190
AI Made Us Faster at Solving the Wrong Problems
marceloancelmo
0
170
分析AIエージェントを育てる、動く環境を育てる
codatum
0
130
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
4
1k
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
360
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
560
形式手法を使って仕様をコーディングしよう
mikanichinose
0
180
ミイダス株式会社 テックチームのご紹介 / MIIDAS Tech Team
miidas
0
160
あなたの知らないAmazon VPC Route Server/Amazon VPC Route Server you don't know about
masakiokuda
2
230
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
270
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
260
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
610
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The SEO identity crisis: Don't let AI make you average
varn
0
580
Faster Mobile Websites
deanohume
310
32k
WENDY [Excerpt]
tessaabrams
14
40k
Raft: Consensus for Rubyists
vanstee
142
7.7k
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!