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
ソフトウェア開発における 「設計」と「パフォーマンス」の相互作用 / Interaction ...
Search
moznion
November 08, 2018
Technology
12
6.9k
ソフトウェア開発における 「設計」と「パフォーマンス」の相互作用 / Interaction Between Design and Performance on Software Development
設計Night2018の資料です
https://connpass.com/event/104821/
moznion
November 08, 2018
Tweet
Share
More Decks by moznion
See All by moznion
Develop to Survive - YAPC::Hakodate 2024 Keynote
moznion
9
14k
これはPerl? それともRuby? クイズ〜〜〜〜〜!!!- Perl or Ruby Quiz
moznion
3
2.4k
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
1
930
RuboCopのカスタムCopを書いてContributionしてみる - Contributing a Custom Cop to RuboCop: A Hands-on Experience
moznion
0
65
AWS上に構築する メンテ容易なElasticsearch System / Maintainable Elasticsearch system on AWS
moznion
2
3.9k
PROXY Protocol aware Proxy Server on Node.js
moznion
2
2.5k
Perl meets AWS Lambda
moznion
0
4.7k
Javaカードの世界 / The world of Java Card
moznion
9
13k
無限にスケールする上に自律的なJenkinsに見る夢~AWS篇~ / Dream of autonomous and infinite scalable Jenkins with AWS
moznion
21
7k
Other Decks in Technology
See All in Technology
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
3
1.3k
リソースのテレメトリも管理したい!〜CloudWatch Telemetry管理のご紹介〜
nnydtmg
0
100
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
240
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
160
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
110
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
220
kargoの魅力について伝える
magisystem0408
0
190
大規模サーバ移行を成功に導くための事前調査フェーズの工夫事例
fukuchiiinu
2
140
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
310
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
100
Oracle Cloud Infrastructure IaaS 新機能アップデート 2024/9 - 2024/11
oracle4engineer
PRO
1
110
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
380
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
GitHub's CSS Performance
jonrohan
1030
460k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Optimising Largest Contentful Paint
csswizardry
33
3k
Music & Morning Musume
bryan
46
6.2k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Docker and Python
trallard
41
3.1k
Navigating Team Friction
lara
183
15k
Transcript
ιϑτΣΞ։ൃʹ͓͚Δ ʮઃܭʯͱʮύϑΥʔϚϯεʯͷ૬ޓ࡞༻ Interaction Between Design and Performance on Software Development
ઃܭNight2018 @moznion
@moznion Software Engineer ࠷ۙαϒςΫʹೖΓ·ͨ͠
DISCLAIMER
۩ମతͳιϑτΣΞઃܭٕ๏ɾख๏ͷ ଞͷൃදʹৡΓ·͢
ʮઃܭʯͱʮύϑΥʔϚϯεʯ
ύϑΥʔϚϯεͷఆٛ (؆ܿʹ) - ߴʹϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ͨ͘͞ΜϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ʮਖ਼֬ʹʯ
ύϑΥʔϚϯεͷఆٛ (؆ܿʹ) - ߴʹϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ͨ͘͞ΜϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ʮਖ਼֬ʹʯ
ύϑΥʔϚϯεͷఆٛ (؆ܿʹ) - ߴʹϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ͨ͘͞ΜϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ʮਖ਼֬ʹʯ
ύϑΥʔϚϯεͷఆٛ (؆ܿʹ) - ߴʹϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ͨ͘͞ΜϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖Δ - ʮਖ਼֬ʹʯ
ͳͥύϑΥʔϚϯεΛٻ͢Δͷ͔
- ྑ͍Πϯλʔωοτମݧͷఏڙ - ΑΓଟ͍ʮػձʯͷग़ - Πϯϑϥઃඋͷ࠷దԽ - ==> ͭ·Γθχʂʂʂʂʂʂ ͳͥύϑΥʔϚϯεΛٻ͢Δͷ͔
- ྑ͍Πϯλʔωοτମݧͷఏڙ - ΑΓଟ͍ʮػձʯͷग़ - Πϯϑϥઃඋͷ࠷దԽ - => ͭ·Γθχʂʂʂʂʂʂ ͳͥύϑΥʔϚϯεΛٻ͢Δͷ͔
ͭ·Γθχʂʂʂʂʂ
ύϑΥʔϚϯε͍ͤ͢͞ઃܭʁ
- ΞϧΰϦζϜ - σʔλߏ - (ϋʔυΣΞ) ύϑΥʔϚϯε͍ͤ͢͞ઃܭ (Ұྫ) - ϑΝϯΞτ
- ΩϡʔΠϯά - Ωϟογϡ ɹ- όον ਨࢦ ਫฏࢦ ͦͷଞ
ਨࢦͷઃܭ
- దͳΞϧΰϦζϜͷద༻ - దͳσʔλߏͷద༻ - සग़) ୳ࡧɼιʔτͳͲ - ͳΜͰ͔ΜͰϋϯϚʔΛͬͯͩΊ ਨࢦͷઃܭ
- ΞϧΰϦζϜσʔλߏখ͍͞ύʔπ - ଞͷઃܭख๏ͱͷΈ߹Θ͕ͤൺֱత༰қ - => ͕໌֬Ͱ͋Δ͜ͱʹڌΓͦ͏ - ࠜຊతͳύϑΥʔϚϯεվળΛਤΔͳΒ͜͜ʂ ਨࢦͷઃܭ
- ʮҰ൪͍͍ϚγϯΛཔΉʯ - ϋʔυΣΞઃܭͷਐาʹཔΔʂʂʂ - ࠓճͷͱҰؔͳ͍Ͱ͢ - ͱ͍͑ϋʔυΣΞͷਐาʹΑͬͯ ιϑτΣΞઃܭͷٕ๏͕มΘΔ͜ͱ͋Γͦ͏ ਨࢦͷઃܭ
(൪֎)
ਫฏࢦͷઃܭ
- ϑΝϯΞτ - ෳͷϓϩηεɾϚγϯͰฒߦॲཧ - ෳͷϓϩηεɾϚγϯͰฒྻॲཧ (ڠௐॲཧ) - (Reactive...?) -
ϑΝϯΠϯ͕ཁΔ (߹͕͋Δ) ਫฏࢦͷઃܭ
- ΩϡʔΠϯά - δϣϒΩϡʔͰޙճ͠େ࡞ઓ (™@nekokak) - ཁόοϑΝϨΠϠʔʹॲཧΛ٧ΊࠐΉ - ϫʔΧʔ (૬)
͕ॲཧΛ͚ෛ͏ - εϩοτϦϯά͕͍͢͠ ਫฏࢦͷઃܭ queue (buffer)
- ΩϡʔΠϯά - ҎԼΛຬ͢ΔڥͰ͋ΕຊʹޮՌత - ϦΞϧλΠϜੑ͕ٻΊΒΕͳ͍ - Ԇ͕ڐ༰͞ΕΔ ਫฏࢦͷઃܭ queue
(buffer)
- (ଟ͘ͷ߹) ඇಉظॲཧ͔Βಀ͛ΒΕͳ͍ - ඇಉظॲཧ͕ϏδωεϩδοΫʹ ͢ΜͳΓ࣮͞ΕΔ͜ͱͦ͏ଟ͘ͳ͍ - ϓϩτίϧελοΫͷ࣮Ͱ͋Δ͔ ਫฏࢦͷઃܭ
- ඇಉظͰಈ͘Α͏ʹ࣮͢Δඞཁ͕ग़ͯ͘Δ - ྫ - ॱংੑʹڍಈΛࢧ͞Εͳ͍ - ႈੑΛ୲อ࣮ͯ͢͠Δ - ײʹ͢Δ߹͕ଟ͍……
ਫฏࢦͷઃܭ
- ύϑΥʔϚϯεͷͨΊͷ߹͕ϏδωευϝΠϯͷ ઃܭΛΊ͕ͪ - ҙਂ͘ઃܭ͢Δͱ͏·͘ಇ͘߹͋Δ (ޙड़) - (ʮӡ͕ྑ͚Εʯ͔͠Εͳ͍) - ͏͔ͬΓૉʹ࣮͢Δͱ……ᄾݺ
ਫฏࢦͷઃܭ
- ࡶଟͳۤ͠ΈΛݺͼ͕ͪ - ϨʔείϯσΟγϣϯ - ϦτϥΠ - εςʔτͷෆ߹ - ͳͲͳͲ……
- Ref: ࢄΩϡʔͱ͍͏໊ͷۤ͠Έ - Software Transactional Memo http://kumagi.hatenablog.com/entry/queue_struggle ਫฏࢦͷઃܭ
- εέʔϧ͢Δʢ͍͢͠ʣʂʂ - ͔͠͠τϨʔυΦϑଟ͍ - ͦΕͰಋೖ͢Δ͔Ͳ͏͔ͷίετஅʢޙड़ʣ ਫฏࢦͷઃܭ
- FaaSʹΑΔύϥμΠϜͷมԽ - ԋࢉϦιʔεΛΦϯσϚϯυͰ҆͑͘ΔΑ͏ʹͳͬͨ - FunctionʹॲཧΛҕৡͯ͠͠·͏ - Firebaseͱ͔Ͱׂͱਪ͞ΕΔख๏ - ʮͱΓ͋͑ͣδϣϒΩϡʔʹೖΕ͓͍ͯͯ͋ͱͰॲཧʯ
- ΊͬͪΌΓ͘͢ͳͬͨ - ୯Ұͷݪଇ (SRP) ͕ൺֱతຬͨ͞Ε͘͢ͳͬͨҹ - (ίϯϙʔωϯτͷϝϯςίετԼ͕Δ) ਫฏࢦͷઃܭ (൪֎?)
SONOTA
- όον - ͋Β͔͡ΊίϯςϯπΛΓΓੜ ͓͍ͯͯ͠ΞϓϦͦΕΛฦ٫͢Δ͚ͩͱ͔ - αϚϦςʔϒϧͱ͔…… - ͜Εଈ࣌ੑͱͷ݉Ͷ߹͍ͷʹͳΔ ͦͷଞ
- Ωϟογϡ - खͬऔΓૣ͍ͥʢةݥࢥʣ - YAPC::Kansai 2017 OSAKAͰ͠·ͨ͠ - https://speakerdeck.com/moznion/pattern-and-strategy-of-
web-application-caching - (↑Ͱ͍ͯ͠ͳ͍ͱͯ͠ϚςϏϡʔ͕͋Γͦ͏) ͦͷଞ
- Ωϟογϡόονຊ࣭త͔Ͳ͏͔ - ଟ͘ͷ߹ຊ࣭తͰͳ͍……ʁ ͦͷଞ
- ຊ࣭ͱͳʹ͔……ʁ - => ϏδωευϝΠϯɾϩδοΫͷ៉ྷ͞ - => θχʂʂʂʂʂʂ ͦͷଞ
- ຊ࣭ͱͳʹ͔……ʁ - => ઃܭͷ៉ྷ͞ - => θχʂʂʂʂʂʂ ͦͷଞ
- ຊ࣭ͱͳʹ͔……ʁ - => ઃܭͷ៉ྷ͞ => θχʂʂʂʂʂʂ ͦͷଞ
ͭ·Γθχʂʂʂʂʂ
- ͔͠͠ - ςΫχΧϧͳ߹͕ιϑτΣΞઃܭʹٴ΅͢Өڹେ͖͍ - ߹ ∈ ϋʔυΣΞɾϛυϧΣΞ - ςΫχΧϧͳղܾख๏ͷ҆қͳಋೖʹΑͬͯ
ΧΦεʹ͔͍ͬͯ͘Մೳੑߴ·Δ - υϝΠϯͷ࣋ͭϐϡΞ͕ࣦ͞ΘΕΔ - ઃܭ͕ΊΒΕ͕ͪ ͦͷଞ
ઃܭ͕ΊΒΕΔʁ
- ઃܭ͕ΊΒΕΔ - => ڍಈ͕Θ͔Γʹ͘͘ͳΔ (ίʔυͷಡΈ͚ͩ͢͞Ͱͳ͍) - => मਖ਼ίετ͕ߴ͘ͳΔ -
=> ϝϯςίετ͕ߴ͘ͳΔ - => ઃܭ͕ΊΒΕ͍ͯΔ͜ͱʹؾͮ͘…… ઃܭ͕ΊΒΕͯԿ͕ѱ͍ʁ
- ઃܭ͕ΊΒΕΔ - => ڍಈ͕Θ͔Γʹ͘͘ͳΔ (ίʔυͷಡΈ͚ͩ͢͞Ͱͳ͍) - => मਖ਼ίετ͕ߴ͘ͳΔ -
=> ϝϯςίετ͕ߴ͘ͳΔ - => ઃܭ͕ΊΒΕ͍ͯΔ͜ͱʹؾͮ͘…… ઃܭ͕ΊΒΕͯԿ͕ѱ͍ʁ
ʮίετʯ
- ৽ͨʹػೳΛ࡞Δίετ - ίʔυͷϝϯςφϯείετ - Πϯϑϥͷϝϯςφϯείετ - => ιϑτΣΞઃܭ͜ΕΒʹӨڹΛٴ΅͢ -
=> ઃܭίετͱͷઓ͍ ίετ
ͭ·Γθχʂʂʂʂʂ
- ίετͷ࣠ - ίϯϐϡʔςΟϯάͷʹΑͬͯϖΠ͢ΔྖҬ - ઃܭͷྑ͞ʹΑͬͯϖΠ͢ΔྖҬ - ަ͢Δ߹͋Ε૬͢Δ߹૬͢Δ߹͋Δ - όϥϯε͕ॏཁ
- ྑ͍ઃܭͷ݅ͷҰͭ: ߹ҙ͕औΕ͍ͯΔ - => ίετͱ߹ҙΛऔΔඞཁ͕͋Δ - ʮσϕϩούͷੜ࢈ੑʯʹݶఆͨ͠Ͱͳ͍ ίετ
υϝΠϯࣝͱύϑΥʔϚϯε
- υϝΠϯʹର͢Δ͕ࣝΓͳ͍߹ - ݟҧ͍ͷ࣮ɾઃܭΛ͕ͪ͠ - ෆదͳσʔλߏΛ࠾༻ͯ͠͠·ͬͨΓ…… - ྑ͍ύϑΥʔϚϯεʹυϝΠϯʹର͢Δࣝɾཧղ͕ඞཁ ʮυϝΠϯࣝͷཧղʯͱύϑΥʔϚϯε
࣮ࡍͲ͏ઃܭ͢Εྑ͍ͷ͔……
ͷʹΑΔ
None
͋͘·Ͱݸਓͷܦݧͷͱͯ͠ฉ͍͍ͯͩ͘͞
- ૉʹϞσϦϯάͯ͠࡞ͬͨ΄͏͕ྑ͍ - ଟ͘ͷ߹࣮༻ʹ͑͏ΔͰಈ͘ - ͪΌΜͱϞσϦϯά͞Ε͍ͯΔ - ࠷ݶৗࣝతͳઃܭɾ࣮͕͞Ε͍ͯΕ…… - ʮඒ͍͠ͷۭؾ߅͕খ͍͞ʯͷਫ਼ਆ
- ࣮ࡍͦΜͳ߹ྑ͘ͳ͍ͷ͕ͩ…… - ࠔͬͨΒͬͪ͜ʹ͓ͯ͘͠ ύϑΥʔϚϯεͱઃܭࢦ
- ͔͋͠͠ΔʢϦϦʔεॳ͔……ʣΛڥʹ໓͢Δ͔ - ͱ͍͏࣌ʹύϑΥʔϚϯεΛਅ໘ʹߟ͑Δ͖ - ཱͪฦͬͯʮྑ͍ઃܭʯͱ - ΞδϦςΟ - ॊೈੑ
- ྑ͍ઃܭ => ࠷దԽͷ༨͕͋Δͣ ύϑΥʔϚϯεͱઃܭࢦ
ྫ
None
௨͢ΔϢʔβ͕ଟ͗͢Δέʔε ௨Λ࡞ͬͯૹΔ෦Ͱ٧·Δ͔ʜʜ
None
ૉʹϑΝϯΞτ ௨࡞Δ෦QVTIૹΔ෦ͦͷ ϓϩηεɾεϨουͰͬͯ͠·͏
None
ߴසͰૹΒΕΔͱ ࢮΜͰ͠·͍·͢ʂ Έ͍ͨͳ߹
None
όοϑΝʹΩϡʔΠϯά ϫʔΧʔͷͰεϩοτϦϯά ͍ͭͰʹ431
None
࣮͜͜ͰڥքΛ͚ΔͱεοΩϦ͢Δʁ
@startuml actor User participant Comment participant WatchingUser participant Queue participant
Worker1 participant WorkerN participant Notification participant PushNotificationGateway Worker1 -> Queue : subscribe WorkerN -> Queue : subscribe User -> Comment : postComment Comment -> WatchingUser : fetchWatchingUser Comment -> Comment : buildNotificationBody Comment -> Queue : enqueueNotificationPayload group publishing as async until queue is empty Queue -> Worker1 : publish Worker1 -> Notification : create Notification -> PushNotificationGateway : sendNotification Queue -> WorkerN : publish WorkerN -> Notification : create Notification -> PushNotificationGateway : sendNotification end @enduml
@startuml actor User participant Comment participant WatchingUser participant Queue participant
Worker1 participant WorkerN participant Notification participant PushNotificationGateway Worker1 -> Queue : subscribe WorkerN -> Queue : subscribe User -> Comment : postComment Comment -> WatchingUser : fetchWatchingUser Comment -> Comment : buildNotificationBody Comment -> Queue : enqueueNotificationPayload group publishing as async until queue is empty Queue -> Worker1 : publish Worker1 -> Notification : create Notification -> PushNotificationGateway : sendNotification Queue -> WorkerN : publish WorkerN -> Notification : create Notification -> PushNotificationGateway : sendNotification end @enduml /PUJpDBUJPOΛ࡞Δ෦͝ͱ ΩϡʔΠϯάͯ͠͠·͏ ϫʔΧʔ͕͍͍ײ͡ʹॲཧ
Notification͝ͱΩϡʔΠϯά͢ΔϞνϕʔγϣϯ - ଈ࣌ੑ͕ͳͯ͘Αͦ͞͏ - Commentdispatchʹઐ೦Ͱ͖Δ - rate limitͱ͔Λߟ͑Δඞཁ͕ͳ͘ͳΔ - ୯ҰͷίϯϙʔωϯτΛݟͨ࣌ʹγϯϓϧ
Notification͝ͱΩϡʔΠϯά͢Δݒ೦ - ෦͕૿͑Δͱෳࡶੑ͕૿͢ - ϛΫϩͩͱγϯϓϧ͕ͩɼϚΫϩͩͱෳࡶʹͳͬͯͳ͍͔ - Worker͕ʮ୭͔ΒૹΒΕ͖ͯͨδϣϒʯ͔͓ͬͯ͘ඞཁ͕ ͋ΔΜ͡Όͳ͍͔ʁ - =>
͜ΕΩϡʔΛΘ͚Εྑ͍ - => ಛఆͷΩϡʔʹಛఆͷ୯ػೳWorkerΛඥ͚Δ - ΩϡʔΛϓϩτίϧͷΑ͏ʹऔΓѻ͏
ͷʹΑΔ (ϘτϧωοΫʹΑΔ) ߟ͍͖͑ͯ·͠ΐ͏
- ૣ͗͢Δ࠷దԽࡑͰ͋Δ - ύϑΥʔϚϯεͷ߹υϝΠϯΛΊ͕ͪ - ·ͣυϝΠϯʹدΓఴͬͨઃܭ͕ྑ͍ - ʮඒ͍͠ͷۭؾ߅͕গͳ͍ʯ - ͔͠͠࠷దԽͷ༨Λ͢͜ͱॏཁ
- ʮ࠷దԽͷ༨͕͋Δઃܭʯ͕ୈҰஈ֊ͱͯ͠ͷྑ͍ઃܭͰͳ͍͔ ύϑΥʔϚϯεͱઃܭࢦ
Q?