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
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
160
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
210
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
730
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
Wantedly での Datadog 活用事例
bgpat
1
400
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
510
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
51
7.3k
Building Your Own Lightsaber
phodgson
103
6.1k
The Language of Interfaces
destraynor
154
24k
Facilitating Awesome Meetings
lara
50
6.1k
Fireside Chat
paigeccino
34
3.1k
A Tale of Four Properties
chriscoyier
157
23k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Producing Creativity
orderedlist
PRO
341
39k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Site-Speed That Sticks
csswizardry
2
190
4 Signs Your Business is Dying
shpigford
181
21k
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?