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
13k
これは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
890
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
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
130
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
200
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
320
Going down the RAT hole: Deep dive into the Vuln-derland of APT-class RAT Tools
nttcom
0
340
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
0
180
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
340
Engineering at LY Corporation
lycorp_recruit_jp
0
610
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
370
第23回Ques_タイミーにおけるQAチームの在り方 / QA Team in Timee
takeyaqa
0
270
音声×Copilot オンコパの世界
kasada
1
120
State of Open Source Web Mapping Libraries
dayjournal
0
240
SREの組織類型に応じた リーダシップの考察
kenta_hi
PRO
1
640
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Producing Creativity
orderedlist
PRO
341
39k
Automating Front-end Workflow
addyosmani
1366
200k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
43
2.2k
Facilitating Awesome Meetings
lara
50
6.1k
Rails Girls Zürich Keynote
gr2m
94
13k
Ruby is Unlike a Banana
tanoku
96
11k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
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?