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
推論基盤と Scale-Up Interconnect の現状と制約から俯瞰する技術動向
markunet
2
560
AIエージェント時代、Kaggleにどう取り組むか
takanao
2
350
Claude Code on Bedrock で統制をかける小ネタ集/claude-code-bedrock-governance-tips
emiki
1
13k
Maestro MCPとClaude Code Skillsによる自律的なE2Eテスト支援
asmz
0
310
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
5
2.5k
自宅サーバと脆弱性
masakiokuda
1
120
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
800
ガチで放置できるClaude Code実行環境の作り方.pdf
lamaglama39
5
10k
小規模OSSモデルは サイバーセキュリティ業務に どこまで使えるか
bbrbbq
0
310
Claude for Google Workspaces ポン出し/claude-for-google-workspace-slide-conversion
emiki
0
13k
LLMの知識とAIエージェント
happysamurai294
0
110
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
7
4.6k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
600
4 Signs Your Business is Dying
shpigford
187
23k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
Typedesign – Prime Four
hannesfritz
42
3.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
540
Prompt Engineering for Job Search
mfonobong
0
550
Building Applications with DynamoDB
mza
96
7.3k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
650
How STYLIGHT went responsive
nonsquared
100
6.3k
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!