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
920
RuboCopのカスタムCopを書いてContributionしてみる - Contributing a Custom Cop to RuboCop: A Hands-on Experience
moznion
0
64
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
IVRyエンジニア忘年LT大会2024 クリティカルユーザージャーニーの整理
abnoumaru
0
130
Replit Agent
kawaguti
PRO
2
210
まだチケットを手動で書いてるの?!GitHub Actionsと生成AIでチケットの作成を自動化してみた話 / 20241207 Yoshinori Katayama
shift_evolve
1
810
pmconf2024_UPSIDER
upsider_tech
0
7.9k
TimeTreeが経た3つの転換点 ー プロダクト成長過程でその時、その瞬間、何を考えてたか
ysmtysts
1
4k
問題を認識して解決できる人は何でもできる
i999rri
0
120
密着! Bedrockerがre:Invent 2024で過ごした5日間を紹介
minorun365
PRO
3
350
テーブルが200以上あるSaaSでRSCとGraphQLを併用する理由
msickpaler
1
490
大規模サーバ移行を成功に導くための事前調査フェーズの工夫事例
fukuchiiinu
2
120
Tailwind CSSとAtomic Designで実現する効率的な Web 開発の事例
toranoana
1
260
宇宙最速のランチRecap LT会(開発者ツール&運用監視編)
nnydtmg
1
190
振る舞い駆動開発(BDD)における、テスト自動化の前に大切にしていること #stac2024 / BDD formulation
nihonbuson
3
1.1k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
21
1.2k
Designing for Performance
lara
604
68k
Rails Girls Zürich Keynote
gr2m
94
13k
A Tale of Four Properties
chriscoyier
157
23k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Optimizing for Happiness
mojombo
376
70k
Designing Experiences People Love
moore
138
23k
Done Done
chrislema
181
16k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Unsuck your backbone
ammeep
669
57k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
27
2.1k
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?