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.3k
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
1
900
RuboCopのカスタムCopを書いてContributionしてみる - Contributing a Custom Cop to RuboCop: A Hands-on Experience
moznion
0
60
AWS上に構築する メンテ容易なElasticsearch System / Maintainable Elasticsearch system on AWS
moznion
2
3.9k
PROXY Protocol aware Proxy Server on Node.js
moznion
2
2.4k
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
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
150
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
複雑なState管理からの脱却
sansantech
PRO
1
130
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
230
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
120
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
180
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
120
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
510
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
290
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Rails Girls Zürich Keynote
gr2m
94
13k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Speed Design
sergeychernyshev
24
610
Become a Pro
speakerdeck
PRO
25
5k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Producing Creativity
orderedlist
PRO
341
39k
RailsConf 2023
tenderlove
29
900
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
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?