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
複数のマイクロサービスと連携したWeb APIの設計と構築 in Playframework ...
Search
Yusuke Wada
September 29, 2016
Programming
0
610
複数のマイクロサービスと連携したWeb APIの設計と構築 in Playframework Scala / play-scala with services
https://eventdots.jp/event/599919
にて発表したスライドです。
Yusuke Wada
September 29, 2016
Tweet
Share
More Decks by Yusuke Wada
See All by Yusuke Wada
Google Cloud でシンプルなブログサイト Xenn をつくろう / xenn-google-cloud-handson
wadayusuke
2
33
Google Cloud で プロダクト開発 事業として成長させるZennの例 / grows-zenn-with-google-cloud
wadayusuke
3
390
ZennにみるCloudRunとBigQueryによるアプリケーション構築 / zenn-cloudrun-bigquery-serverless
wadayusuke
14
6.1k
Zennを支える Google Cloud の技術
wadayusuke
5
890
個人ブログサイトを構築して学ぶGraphQL NestJSとNext.js使うよ! / graphql nestjs nextjs bootcamp
wadayusuke
7
3.5k
Step Functions と Lambda Function で組む Athena によるファイル処理 / serverless lightweight etl
wadayusuke
3
3.7k
Deploy production with AWS CDK / 実践プロダクションサーバーレス
wadayusuke
1
4.5k
TypeScriptとJestではじめる AWS製サーバーレス REST API のユニットテスト・E2Eテスト #serverlessfukuoka #serverlessdays / Serverless testing using TypeScript and Jest
wadayusuke
3
10k
Webアプリエンジニアに贈る アプリケーション開発におけるサーバーレス流の考え方 / The concept of serverless in application development
wadayusuke
19
9.6k
Other Decks in Programming
See All in Programming
Prompt Cachingは本当に効果的なのか検証してみた.pdf
ttnyt8701
0
530
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
220
connect-go で面倒くささと戦う / 2024-08-27 #newmo_layerx_go
izumin5210
2
640
A New Era of Testing
mannodermaus
2
480
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
380
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
140
2024 컴포즈 정원사
jisungbin
0
150
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
Rubyのobject_id
qnighy
6
1.3k
いまから追い上げる、Jetpack Compose トレーニング
nyafunta9858
0
510
The Shape of a Service Object
inem
0
520
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
41
6.5k
Thoughts on Productivity
jonyablonski
66
4.2k
The Cult of Friendly URLs
andyhume
76
6k
How to train your dragon (web standard)
notwaldorf
85
5.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
What's new in Ruby 2.0
geeforr
340
31k
Six Lessons from altMBA
skipperchong
26
3.3k
Producing Creativity
orderedlist
PRO
340
39k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
Happy Clients
brianwarren
96
6.6k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
Building Better People: How to give real-time feedback that sticks.
wjessup
359
18k
Transcript
8FC"1*ͷ ઃܭͱߏங JO1MBZGSBNFXPSL4DBMB Ϋϥεϝιουגࣜձࣾɹా༞հ #dots_meetup
• ձࣾ֓ཁ • Ϋϥεϝιουגࣜձࣾ • ʮͯ͢ͷਓʑͷ׆ಈʹߩݙ͠ଓ͚Δʯ • ࣄۀ༰ • "84ίϯαϧςΟϯά
• ϞόΠϧΞϓϦ։ൃ • Ϗοάσʔλੳ • %FWFMPQFST*0ͷϒϩά 2 ձࣾհ
• ໊લɿా༞հ • ܦྺ • ݄ɿभେֶେֶӃଔ • ݄ɿෆಈ࢈͚ΫϥυαʔϏεͷ։ൃձࣾೖࣾ • 8JDLU
+BWB Ͱ8FCΞϓϦͷ։ൃɾอकӡ༻ • ݄ɿΫϥεϝιουגࣜձࣾೖࣾ • ϞόΠϧΞϓϦͷ"1*։ൃΛ୲ 3 ࣗݾհ
ࠓɺϞόΠϧΞϓϦͷόοΫΤϯυ8FC"1*։ൃ ͷɺ͓Ͱ͢
ͳͥࢲͨͪ৽͍ٕ͠ज़ΛٻΊΔͷ͔ • αʔϏεͷ࣭Λ্͍͛ͨ • αʔϏε๊͕͑ΔΛղܾ͍ͨ͠ • ։ൃޮΛ্͍͛ͨ • ୯७ʹָ͍͠ •
นʹͿͪ͋ͨͬͯղܾͨ͠ͱ͖ͷخ͠͞ΛͱΊͯ • ϒϥϯσΟϯάʢձࣾͱͯ͠PSݸਓͱͯ͠ʣ 5
৽ٕज़ͷ࠾༻৽͍͠खஈͷ֫ಘࢿ
ࠓ͢͜ͱ • ͳͥ1MBZGSBNFXPSL4DBMB͔ • ͳʹ͕ͭ͘ΕΔ͔ • ࢿ͢ΔՁ͕͋Δ͔ 7
ͳͥ1MBZ4DBMB͔
4DBMBʁ • 0CKFDU0SJFOUFE.FFUT'VODUJPOBM • 53"*54 • $PNCJOFUIFqFYJCJMJUZPG +BWBTUZMFJOUFSGBDFT XJUIUIFQPXFSPGDMBTTFT 5IJOLQSJODJQMFENVMUJQMFJOIFSJUBODF
• 1"55&3/."5$)*/( • 5IJOLlTXJUDIzPOTUFSPJET .BUDIBHBJOTUDMBTTIJFSBSDIJFT TFRVFODFT BOENPSF 9 The Scala Programming Language http://www.scala-lang.org/
1MBZGSBNFXPSLʁ • %FWFMPQFSGSJFOEMZ • 5ZQFTBGFUZ • #VJMUJOUFTUJOHUPPMT • 4DBMFQSFEJDUBCMZ •
/POCMPDLJOH*0 • #VJMUPO"LLB • .PEFSOXFCNPCJMF • 3&45GVMCZEFGBVMU • +40/JTBpSTUDMBTTDJUJ[FO 10 Play Framework - Build Modern & Scalable Web Apps with Java and Scala https://www.playframework.com/
ฐࣾʹͯ8&#"1*ͷ։ൃͰར༻ • ϞόΠϧόοΫΤϯυͱͯ͠ͷ8FC"1*Λ։ൃ͍ͯ͠·͢ • աڈʹOPEFKTSVCZͰ • ݱࡏ1MBZGSBNFXPSL4DBMB͕ϝΠϯ 11 O’Reilly Japan
- ϚΠΫϩαʔϏεΞʔΩςΫνϟ https://www.oreilly.co.jp/books/9784873117607/
ٕज़ͷબఆͲͷΑ͏ʹߦͬͨͷ͔ • ։ൃ͢ΔγεςϜ͕େنʹͳ͍ͬͯ͘ɺՃ։ൃ͕͋Δͱ ͍͏લఏʹཱͬͯߟ͑ͨ • ύϑΥʔϚϯε • 1MBZ4DBMBWTOPEFKTWT3VCZPO3BJMT • ࣾϕϯνϚʔΫͰ1MBZ4DBMBͷਓউͪ
• େنͳίʔυͷॻ͖͢͞ɾݟ͢͞ • ΦϒδΣΫτࢦͱؔܕͷ͍͍ͱ͜औΓ • Ճɾमਖ਼ͷετϨεܰݮ 12
ͳͥ1MBZGSBNFXPSL4DBMB͔ • ։ൃ໘ • େنɾՃ։ൃͷલఏʹͨͬͨͱ͖ͷϝϯςφϯεੑ • -JOLFE*OΛ͡Ίͱͨ͠େنγεςϜͰͷ࠾༻ࣄྫ͋Γ • ӡ༻໘
• +7. "LLBɻੑೳ͕ظͰ͖Δ • +BWBͰͷӡ༻ݟɾӡ༻πʔϧ͕ྲྀ༻Ͱ͖Δ 13 [*] The Play Framework at LinkedIn | LinkedIn Engineering https://engineering.linkedin.com/play/play- framework-linkedin
ͳʹ͕ͭ͘ΕΔ͔
ঢ়گઃఆ • ϞόΠϧΞϓϦ։ൃҊ݅Λडͨ͠ɻ͓٬༷Ϣʔβاۀ • ཁٻͦͷͷϞόΠϧΞϓϦͱͦͷ$.4ͷ։ൃͰɺ8FC "1*Ұॹʹ։ൃ͢Δ • ͢Ͱʹళฮͷ104ϨδϙʔλϧαΠτ͚ʹՔಇ͍ͯ͠Δ ଞϕϯμͷαʔϏε͕͋Δ •
Ծ௨՟αʔϏεʢίΠϯͷݮࢉɺՃࢉʹରԠʣ • ܠαʔϏεʢܠͷ༩ػೳ͕͋Δʣ 15
ঢ়گઃఆ 16
ͷ͢͢Ίํ • ϞόΠϧόοΫΤϯυͷཁٻʹରͯ͠ɺ1MBZ 4DBMB "84 ΛͬͯͲͷΑ͏ʹઃܭɾ։ൃ͔ͨ͠Λ࣮୲ͷࢹ͔Β ͠·͢ • Ϣʔβొॲཧ •
ଞͷαʔϏεͱ࿈ܞͨ͠ॲཧ • ςετʹΑΔ࣭ͷ্ 17
ͷ͢͢Ίํ • ϞόΠϧόοΫΤϯυͷཁٻʹରͯ͠ɺ1MBZ 4DBMB "84 ΛͬͯͲͷΑ͏ʹઃܭɾ։ൃ͔ͨ͠Λ࣮୲ͷࢹ͔Β ͠·͢ • Ϣʔβొॲཧ •
ଞͷαʔϏεͱ࿈ܞͨ͠ॲཧʢࠓ͜Εʣ • ςετʹΑΔ࣭ͷ্ 18
ίΠϯͱܠΛ ަͰ͖ΔΑ͏ʹͯ͠ɻ
՝ • ୯७ʹίΠϯΛݮΒͯ͠ܠΛ͚ͭΔ͚ͩͰෆे • ͭͷαʔϏεͷؒͰτϥϯβΫγϣϯΛΕͳ͍͜ͱ͕࠷ େͷ՝ 20
ํ • ͍ͪΜආ͚͍ͨঢ়گɺ ίΠϯ͕ݮͬͯɺܠ͕༩Ͱ͖ͳ͍͜ͱɻ ࢭ͢ΔͨΊʹɺ • ίΠϯΛݮΒ͢લʹϩοΫ • ܠ༩ʹࣦഊͨ͠ΒɺϦτϥΠΛ͔͚Δ •
։࢝ɾऴྃϩάΛग़͢ 21
࣮ 22
ॲཧͷϩοΫ • ͍࣌ؒ͘͝ʹɺҙਤͤͣ࿈ଓͯ͠ొϦΫΤετ͕ඈΜͰ ͖ͨ߹ɺσʔλෆ߹͕ൃੜ͢Δ͔͠Εͳ͍ • ϞόΠϧΞϓϦ͚ͩʹ੍ޚΛٻΊΔͷࠅ • ႈੑΛ୲อͰ͖ͳ͍1651045ϦΫΤετΛอޢ͍ͨ͠ • 3FEJTͷTFUOYͷੑ࣭Λར༻ͯ͠ϩοΫΛ࣮ݱ͢Δ
• &MBTUJDBDIFΛར༻͢Δ͜ͱͰϚϧναʔόڥͰͷϩοΫ ػߏ͕࣮ݱͰ͖Δ 23
ϦτϥΠॲཧͷྫ • 424ͰϦτϥΠϝοηʔδΛཧ • ϝοηʔδͷडऔਓͱͳΔϫʔΧʔΛ 1MBZGSBNFXPSLʹಉࠝ͞Ε͍ͯΔ"LLB"DUPSͰ࣮͢Δ • "DUPSࢄγεςϜʹΑΔߴ͍ॲཧੑೳΛތΔ͕ɺࠓճͷέʔ εͰ4VQFSWJTPS4USBUFHZʹΑΔϑΥʔϧττϨϥϯεͷଆ ໘Λॏࢹ
24 Fault Tolerance — Akka Documentation http://doc.akka.io/docs/akka/snapshot/scala/fault-tolerance.html
։࢝ɾऴྃϩάͷྫ • <*/'0>GSPNUSBOTBDUJPOJO5SBOTBDUJPO"DUPS-PHHFSBLLBBDUPSEFGBVMU EJTQBUDIFS USBOTBDUJPOUZQF$PJO&YDIBOHFUSBOTBDUJPOUBH$PJO&YDIBOHF4UBSU USBOTBDUJPOUSBOTBDUJPO)BTI,FZGDEGCCFGC USBOTBDUJPOKTU5SBOTBDUJPO%BUF5JNF5 • <*/'0>GSPNUSBOTBDUJPOJO5SBOTBDUJPO"DUPS-PHHFSBLLBBDUPSEFGBVMU EJTQBUDIFS
USBOTBDUJPOUZQF$PJO&YDIBOHFUSBOTBDUJPOUBH$PJO&YDIBOHF'JOJTI USBOTBDUJPOUSBOTBDUJPO)BTI,FZGDEGCCFGC USBOTBDUJPOQSFTFOU*E& USBOTBDUJPOKTU5SBOTBDUJPO%BUF5JNF5 USBOTBDUJPOSFTVMU4VDDFTTUSBOTBDUJPOOPUF$PJOFYDIBOHFDPNQMFUFEz • "DUPS-PHHJOHͰຊॲཧͷύϑΥʔϚϯεΛམͱͣ͞ඇಉظϩάग़ྗ͕Մೳ 25 Logging (Scala) — Akka Documentation http://doc.akka.io/docs/akka/2.0/scala/logging.html
ͳʹ͕ͭ͘ΕΔ͔ʁ • ෳͷϚΠΫϩαʔϏεͱ࿈ܞͨ͠όοΫΤϯυ • %ZOBNP%#424ҰछͷϚΠΫϩαʔϏε • ඇಉظʹΞΫηεɺཉ͍͠෦Λ౷߹ͯ͠ΫϥΠΞϯτฦ͢ • େنͳ8FC"1* •
σβΠϯύλʔϯ͕ద༻Ͱ͖ΔΫϥεߏ • ؔܕͷ؆͕ܿ͞ద༻Ͱ͖ΔϩδοΫ • ߴՄ༻ΞϓϦέʔγϣϯ • +BWBͷڧྗͳΤίγεςϜͷԸܙʹ͔͋ͣΕΔ • l+7.্Ͱಈ͔͠ଓ͚Δʹzݟ͕ྲྀ༻Մೳ 26
ΞϦ͔ʁφγ͔ʁ
1MBZ4DBMBࢿ͢ΔՁ͕͋Δ͔ʁ • ΞϦʂ • େنʢΤϯυϙΠϯτ͕Ҏ্ʣ • όοΫΤϯυͱͯ͠ͷ"1*։ൃ • +BWB3VCZΤϯδχΞ͕ͦΘͦΘ͍ͯ͠Δ •
ҙʂ • ͪΐͬͱͨ͠αʔϏεΛ࡞ΔఔͰԸܙΛײ͡ͳ͍͔͠Ε·ͤ ΜɻΔͳΒҊ݅ϨϕϧͰɻ৽αʔϏεɺϑϧϦχϡʔΞϧ • ڭҭίετɻΤίγεςϜؚΊ͍ͯ͜ͳͤΔΑ͏ʹͳΔ ఔඞཁɻͰ͖Εઌಋͯ͘͠ΕΔϝϯόʔ͕ډΔͱޮྑ͍ɻ 28
ฐࣾͰ͜ΜͳਓࡐΛืू͍ͯ͠·͢ • ࠷৽ͷٕज़Λ࣮Ҋ݅ੵۃతʹೖ͍ͨ͠ʂ • "84ɺαʔόʔαΠυɺϞόΠϧΞϓϦؔ͢ΔઐతͳΤ ϯδχΞͱҰॹʹಇ͖͍ͨʂ • %FWFMPQFST*0Ͱϒϩάॻ͖͍ͨʂ • εΩϧ
• J04"OESPJE • +BWB4DBMB3VCZ • "84 29
νʔϜମ੍ • J04։ൃਓ • "OESPJE։ൃਓ • ϞόΠϧόοΫΤϯυ։ൃʢ8FC"1* $.4ʣਓ • Ϛωʔδϝϯτɺਐཧਓ
30
ར༻πʔϧ • 4MBDL • ϝϯόʔಉ࢜ͷίϛϡχέʔγϣϯɺ$*௨ɺϩάࢹ௨ • (JU)VC 5SBWJT$* • "OTJCMF
$MPVE'PSNBUJPO • -PHFOUSJFT • %BUBEPH • ;VCF ;FO)VC 31
'"2 • ೖࣾͨ͠Βͦͷٕज़͔Γʁ • ͍͍͑ɺͬͺΓϞόΠϧΞϓϦ࡞Γ͍ͨɺαʔόαΠυ͕Γ ͍ͨɺΞϦͰ͢ɻ࣮ࡍʹҠͬͨΤϯδχΞͨ͘͞Μ͍·͢ • ٕज़ྗߴͦ͏ͳਓ͔ΓͳΠϝʔδʁ • ֤ʑಘखෆಘख͋Γ·͢ɻʮ͜ΕͩͬͨΒ͍͚ͬͯΔ͔ʯͱ
ձࣾઆ໌ձࢀՃͳͬͨ͞ํʑͷײ • ϒϩάͬͯઈରॻ͔ͳ͍ͱ͍͚ͳ͍ͷʁ • ͦΜͳ͜ͱͳ͍Ͱ͢ɻͨͩॻ͖ͨ͘ͳΔෆࢥٞͳνΧϥ͕͜ͷ ձࣾʹ͋Δ 32