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
ScalaとPerlでMicroservices in production / Buildi...
Search
aereal
September 28, 2017
Technology
0
5.4k
ScalaとPerlでMicroservices in production / Building microservices with Perl and Scala in production
aereal
September 28, 2017
Tweet
Share
More Decks by aereal
See All by aereal
How to send distibuted traces to Datadog using build own OpenTelemetry-Lambda distribution
aereal
3
210
好きな技術《コト》で、 生きていく技術 / life with what you like
aereal
5
2.4k
qron: Cloud Native Cron Alternativeの今
aereal
2
2.1k
自動作曲入門 / introduction to programatic music composition
aereal
1
530k
はてなブログ タグとCDK / The epic of AWS CDK and Hatena Blog Tag
aereal
3
200k
はてなブログ タグの技術選択 / The technical details of Hatena Blog Tag
aereal
3
200k
ブログサービスのHTTPS化を支えたAWSで作るピタゴラスイッチ / The construction of large scale TLS certificates management system with AWS
aereal
3
400k
AWSではてなブログの常時HTTPS配信をバーンとやる話 / The Epic of migration from HTTP to HTTPS on Hatena Blog with AWS
aereal
14
17k
Scalaで自動作曲の練習 / A study of automatic composition in Scala
aereal
1
390k
Other Decks in Technology
See All in Technology
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
Kubeshark で Kubernetes の Traffic を眺めてみよう/Let's Look at k8s Traffic with Kubeshark
kota2and3kan
3
370
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
520
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
830
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
730
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
250
OpenShift Virtualizationのネットワーク構成を真剣に考えてみた/OpenShift Virtualization's Network Configuration
tnk4on
0
130
生成AIのガバナンスの全体像と現実解
fnifni
1
180
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
How to Ace a Technical Interview
jacobian
276
23k
The Language of Interfaces
destraynor
154
24k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
160
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
4 Signs Your Business is Dying
shpigford
181
21k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Bash Introduction
62gerente
608
210k
BBQ
matthewcrist
85
9.4k
Scaling GitHub
holman
458
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Transcript
ScalaͱPerlͰ Microservices in production id:aereal @ Cookpad Tech Kitchen #11
feat. ͯͳ
ࣗݾհ • id:aereal • גࣜձࣾͯͳ (2012ʙ) • ͯͳϒοΫϚʔΫ • ͯͳϒϩά
(ςοΫϦʔυ) • Perl, Ruby, Scala, Shell Script
ͯͳʹ͓͚ΔςοΫϦʔυɺ ͦͯ͠αʔϏεϓϥοτϑΥʔϜνʔϜͷ ςοΫϦʔυʹ͍ͭͯ http://developer.hatenastaff.com/entry/2017/09/28/110000
ΞδΣϯμ • Microserviceͱͯ͠࡞ͬͨ৽αʔϏεʹ͍ͭͯ • ຊ൪ೖͯ͠ͷ࠾ • Ψόφϯε • ڍ͍͛ͯͨ՝ղܾ͞Ε͔ͨ
৽αʔϏεʹ͍ͭͯ
http://hatenablog.com/
“ͯͳϒϩάΛͬͱຊ֨తʹ͍͍ͨํͷͨ Ίʹɺ༗ྉϓϥϯʮͯͳϒϩάProʯΛ༻ҙ͠ ͓ͯΓ·͢ɻࠂͷඇදࣔಠࣗυϝΠϯػೳ ͳͲɺͯͳϒϩάΛΑΓศརʹ͓͍͍ͨͩ ͚·͢ɻ” http://hatenablog.com/guide/pro
ͯͳϙΠϯτ ΫϨδοτΧʔυ ίϯϏχৼࠐ ۜߦৼࠐ ༻ https://www.hatena.ne.jp/shop/point/list
http://hatena.g.hatena.ne.jp/hatena/20150529/1432869070
վम or ࡞Γ͠ • چγεςϜϞϊϦγοΫ • ܾࡁͯͯ͠ͳϙΠϯτΛνϟʔδ͢Δ • ͯͳϙΠϯτΛͬͯߪೖ͢Δ •
༷Λཧ͢Δ͍͍ػձͰ͋Δ
ܾࡁߦαʔϏε (֎෦) ͯͳͷαʔϏε (ϒοΫϚʔΫͳͲ) ݱߦܾࡁγεςϜ ϙΠϯτཧ ڞ༗Ϟδϡʔϧ ༗ྉϓϥϯཧ ґଘ ͯͳͷαʔϏε
ґଘ ͯͳͷαʔϏε ґଘ etc. ΞΧϯτ چܾࡁγεςϜͷߏ
چܾࡁγεςϜͷߏ • ܾࡁγεςϜ: WebΞϓϦέʔγϣϯ • APIͳ͘HTMLͷϑΥʔϜ͕͋ΔͷΈ • ڞ༗Ϟδϡʔϧ: ܾࡁߦαʔϏεͱ௨৴͢Δ࣮ •
ͨ͘͞ΜͷϦϙδτϦ͔Βґଘ͞Ε͍ͯΔ • ڞ༗DBΛૢ࡞͢Δ
چܾࡁγεςϜͷվम? • ΄ͱΜͲݱ࣮తͰͳ͍ • ޓੑʹؔ͢ΔεΩʔϜ͕ͳ͍ • શޙํޓ or die •
ෳͷυϝΠϯ͕ೖΓཚΕ͍ͯΔ • ݱࡏͷ༷ʹӨڹΛڧ͘ड͚Δ • վળ͕·ΘΒͳ͍
ϑϧεΫϥον
৽ܾࡁγεςϜ • ܾࡁߦαʔϏεͷήʔτΣΠͱͯ͠ಇ͘ • ͯͳϒϩάProͷ༩ͳͲ֤αʔϏεʹҠৡ • JSON over HTTPͳAPIͷΈΛఏڙ͢Δ •
ରSSKDs (= small set of known developers)
৽ܾࡁγεςϜ ߏਤ ܾࡁߦαʔϏε (֎෦) ͯͳͷαʔϏε ༗ྉϓϥϯͷ ঢ়ଶཧ ৽ܾࡁγεςϜ UI API
http://staff.hatenablog.com/entry/2017/07/10/160000
ຊ൪ೖͯ͠ͷ࠾
ͦͷલʹৼΓฦΓ
ϚΠΫϩαʔϏεͰ࡞Δ͔ • 1ʙ3ষʹ͔͚ͯϝϦοτ ʮ༏ΕͨαʔϏεʯʹ͍ͭͯ ड़ΒΕ͍ͯΔ • ϚΠΫϩαʔϏεʹΑͬͯ αʔϏεΑΓΑ͘ͳΔͷ͔ • ΨόφϯεͳͲɺ
ίετ͑ΔͩΖ͏͔ https://www.oreilly.co.jp/books/9784873117607/
ૄ݁߹ͱߴڽूੑ 1. ϞϊϦγοΫͰखΛೖΕͮΒ͍ (ີ݁߹) 2. ৽ͨʹ༗ྉϓϥϯΛಋೖ͍ͨ͠αʔϏε࠶࣮ 3. υϝΠϯ͕ࣝྲྀग़ (ڽूੑ) 4.
࣋ଓՄೳʹ࡞Γ (ͳ͓͠) ͍ͨ • είʔϓΛখ͘͞໌ྎʹอͭ • ૄ݁߹ (ʰϚΠΫϩαʔϏεΞʔΩςΫνϟʱ3.2.1) • ߴڽूੑ
(ʰϚΠΫϩαʔϏεΞʔΩςΫνϟʱ3.2.2) • ׂ౷࣏͢Δ • ٕज़ҟ࣭ੑ • σϓϩΠͷϥΠϑαΠΫϧΛૣΊΔ
͏·͍ͬͨ͘? • Ψόφϯε͏·͍͔ͬͨ͘ • ૄ݁߹ʹͳ͔ͬͨ • ߴڽूʹͳ͔ͬͨ
Ψόφϯε: ̋ • ͯͳϒϩάͱ৽ܾࡁγεςϜΛ ڠௐͤͯ͞มߋ͢Δඞཁ͕͋Δ • → νʔϜΛϞϊϦγοΫʹ͢Δ͜ͱͰஅΛ͛ͨ • ଞνʔϜͱͷ࿈ܞ͓͓ΉͶى͖ͳ͔ͬͨ
• ৽ܾࡁγεςϜͷϏδϣϯΛڞ༗͍ͯͨ͠ • → ͍͖ͳΓγεςϜ͕ૠ͛ସΘΔ͜ͱͳ͔ͬͨ
ϞϊϦγοΫͳνʔϜ • ͯͳϒϩάଆͷ։ൃͱ৽ܾࡁγεςϜͷ։ൃϝϯόʔΛ Ұகͤͨ͞ • (ॳɺͯͳϒϩάଆΛଞͷϝϯόʔʹ͓ئ͍͢Δ͜ͱ ݕ౼͍ͯͨ͠) • → ͕ࣝڽू͞ΕɺຊʹඞཁͳͷΛదʹ࡞Εͨ
ૄ݁߹: ̋ • UIͱAPIΛผͷݴޠͰ࣮͢Δ͜ͱͰஅ • UI = Perl, API =
Scala • → چγεςϜͰͱͳͬͨڞ༗ΧʔωϧԽΛ͙ • ޓ͕ඞཁͳೝূΛUIʹཹΊΒΕͨ • → ݁Ռͱͯ͠UI͕APIʹର͢ΔഊࢭʹͳΔ
ߴڽूੑ: ˚ • UIͱAPIͷσϓϩΠλΠϛϯάΛἧ͑Δඞཁ͕͋Δ • → ͚ͩ͜͜ݟΔͱ࣌ظঘૣͩͬͨײ͋Δ • ʮ࠷ॳͷ30ؒແྉͰར༻Ͱ͖Δʯͱ͍͏ใɺ ͯͳϒϩάʹด͍ͯ͡ΔͷͰച্ूܭ͕͍͠
• → ϞσϦϯάదͩͬͨͱࢥ͏ͷͰɺ ूܭํ๏ͷվળͳͲͰΞϓϩʔν͍ͨ͠
࠾: 70 • ͋ͱ͔ΒϦΧόʔͮ͠Β͍ (ྫ: Ψόφϯε) ઌʹखΛଧͯͨ • Ұํɺٕज़తͳΞϓϩʔν
(ྫ: σϓϩΠɺ౷߹ςετ) ·ͩ·ͩΕΔ͜ͱ͕͋Δ
·ͱΊ
MicroservicesԽΞϦ͔ • ৽ܾࡁγεςϜͰ࠾༻ͨ͠ͷਖ਼ղͩͬͨ • MicroservicesܥΛ࡞ΔͨΊͷσβΠϯ • = νʔϜ (ਓɺ৫) ·ͰϚΠΫϩʹׂ͢Δඞཁͳ͍
• ͦͷΘΓ͖ͪΜͱࢠΛඃΓͤͳ͍ͱ͍͚ͳ͍