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.3k
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
200
好きな技術《コト》で、 生きていく技術 / life with what you like
aereal
5
2.3k
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
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
TypeScript、上達の瞬間
sadnessojisan
46
13k
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
110
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
530
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
120
Lambdaと地方とコミュニティ
miu_crescent
2
360
CysharpのOSS群から見るModern C#の現在地
neuecc
1
3k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
203
24k
Designing Experiences People Love
moore
138
23k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Navigating Team Friction
lara
183
14k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Making Projects Easy
brettharned
115
5.9k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
What's new in Ruby 2.0
geeforr
343
31k
Designing for Performance
lara
604
68k
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ܥΛ࡞ΔͨΊͷσβΠϯ • = νʔϜ (ਓɺ৫) ·ͰϚΠΫϩʹׂ͢Δඞཁͳ͍
• ͦͷΘΓ͖ͪΜͱࢠΛඃΓͤͳ͍ͱ͍͚ͳ͍