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
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
230
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
200
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
110
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
200
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
210
なぜCodeceptJSを選んだか
goataka
0
160
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
36
13k
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
410
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
GraphQLとの向き合い方2022年版
quramy
44
13k
Statistics for Hackers
jakevdp
796
220k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Music & Morning Musume
bryan
46
6.2k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Faster Mobile Websites
deanohume
305
30k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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ܥΛ࡞ΔͨΊͷσβΠϯ • = νʔϜ (ਓɺ৫) ·ͰϚΠΫϩʹׂ͢Δඞཁͳ͍
• ͦͷΘΓ͖ͪΜͱࢠΛඃΓͤͳ͍ͱ͍͚ͳ͍