Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Scalable Architecture with RabbitMQ
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
nownabe
November 24, 2015
Technology
750
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Scalable Architecture with RabbitMQ
IDCFクラウドのバックエンドをMicroservicesで作って、各コンポーネント間の通信にRabbitMQを使っているという話。
nownabe
November 24, 2015
More Decks by nownabe
See All by nownabe
ナレッジワークの成長を加速する Platform Engineering 戦略
nownabe
0
310
Go で Cloud Logging を 使いこなすための slog 活用法
nownabe
1
2.3k
Other Decks in Technology
See All in Technology
omasushiというライブラリを作った
polidog
PRO
0
220
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
560
コスト最適化の「めんどくさい」を AWS FinOps Agent でチョット楽にする
classmethod_kaz
0
340
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
120
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
890
【技術的負債conf】事業成長に伴う技術的負債の説明責任とAIによるモニタリング、認知的負債について
i35_267
2
910
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
390
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
150
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
360
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
3
510
絵ではじめるKubernetesセキュリティ
aoi1
3
480
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
230
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Unsuck your backbone
ammeep
672
58k
4 Signs Your Business is Dying
shpigford
187
23k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Everyday Curiosity
cassininazir
0
320
Testing 201, or: Great Expectations
jmmastey
46
8.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Transcript
Scalable Architecture with RabbitMQ IDCϑϩϯςΟΞ UX։ൃ෦ ᬑঘޗ 2015/11/24
Slides’ URI https://speakerdeck.com/nownabe/scalable- architecture-with-rabbitmq
Who? ᬑঘޗ @nownabe Programmer Drummer
History 20134݄ IDCFೖࣾ 20137݄ ΧελϚʔαʔϏεຊ෦ϓϥοτϑΥʔϜαʔϏε෦Ϋϥυάϧʔϓ • Ϋϥυج൫ӡ༻ɾݕূ • αόϑΣε্ཱͪ͛ •
MBaaSαʔϏε։ൃ 20144݄ ٕज़։ൃຊ෦R&Dࣨ • MBaaSαʔϏε։ൃ • RDBαʔϏε։ൃ 20151݄ ٕज़։ൃຊ෦UX։ൃ෦ • RDBαʔϏε։ൃ • ϩʔυόϥϯαʔαʔϏε։ൃ (now!)
Favorites Ruby Itamae Ruboty React esa Daemon Chain Drive (double)
Aquiles Priester
Scalable Architecture with RabbitMQ
Γͷ Publish / Subscribe ͱ Microservices ͬͯΈͨ
Which service? ݱࡏ։ൃத IDCF Cloudͷ৽αʔϏε ϩʔυόϥϯαʔαʔϏεͷόοΫΤϯυ ͦΖͦΖʁϦϦʔε༧ఆ
What service? 7. 7. 7. … 4DBMBCMF #BDLFOE -# -#
… *%$'$MPVE $MPVE4UBDL ࡞ͬͨΓফͨ͠Γ ૿ͨ͠ΓݮΒͨ͠Γ ࢹͨ͠Γम෮ͨ͠Γ
8PSLFS … $POUSPMMFS … "1* … .POJUPS … -#OPEF -#OPEF
……… Scalable architecture
8PSLFS … $POUSPMMFS … "1* … .POJUPS … -#OPEF -#OPEF
……… Scalable architecture 3&45"1*ड͚Δͭ ࢹɾ՝ۚ͢Δͭ ࡞ͬͨΓফͨ͠Γ͢Δͭ ϩʔυόϥϯαʔຊମ ͍Ζ͍ΖΔͭ
Development style Ruby Github Qiita:Team Slack
Today’s topics ͢ RabbitMQ (Publish / Subscribe) Microservices ͞ͳ͍ RabbitMQͷෛՙࢄ/Խ
Monitoring (Sensu)
RabbitMQ
What is RabbitMQ? ϝοηʔδͷड৴ͱ৴ Advanced Message Queuing Protocol OSS࣮ Erlang
Why RabbitMQ? MicroservicesԽͰશ෦REST API͖͍ͭ ߴػೳ ୯ମͰಈ࡞͢Δ υΩϡϝϯτ͕ॆ࣮ͯͨ͠
Publish / Subscribe Producer (Publisher) Queueʹ৴ Consumer (Subscriber) Queue͔Βߪಡ Queue
✉ ✉ ✉ ✉ ✉ ✉ ✉ ✉ ✉
Exchange ϝοηʔδΛQueueʹୡ͢Δਓ ͍ͭ͜ͷ͓͔͛Ͱ৴ܦ࿏͕ॊೈ
Example: Fanout ✉ ✉ ✉ ✉ ✉ &YDIBOHF ✉ ඥͮͯ͘͢ͷ
Queueʹୡ
Example: Roundrobin ✉ &YDIBOHF ✉ ✉ ✉ ✉ ✉ ʮՋͳਓʹ৴ʯՄ
Example: RPC ✉ ✉ Request/Response (Exchangeলུ) ฦ৴༻Queue
More complecated routings ͔ͳΓෳࡶͳϧʔςΟϯάՄೳ
Microservices
8PSLFS … $POUSPMMFS … "1* … .POJUPS … -#OPEF -#OPEF
……… Components 3&45"1*ड͚Δͭ ࢹɾ՝ۚ͢Δͭ ࡞ͬͨΓফͨ͠Γ͢Δͭ ϩʔυόϥϯαʔຊମ ͍Ζ͍ΖΔͭ
Why microservices? ScalableͳઃܭΛٻΊΒΕͨ • CloudStack͕ҰຕؠͰεέʔϧ͠ʹ͍͘ઃܭ ֤ίϯϙʔωϯτͷׂׂ͕໌֬ͩͬͨ • ͋ΔఔͲ͏͚Ε͏·͍͖ͦ͘͏͔͔͍ͬͯͨ ΞδϟΠϧʹ׳Ε͍ͯͳ͍ •
ΥʔλʔϑΥʔϧͬΆ͘ॎׂΓ։ൃ
Our Microservices
API gateway ֎෦ϦΫΤετΛ࠷ॳʹॲཧ͢Δड REST APIΛఏڙ Ϣʔβͷೝূ ControllerʹϦΫΤετΛ͑Δ
Controller ͍Ζ͍Ζஅͯ͠ࢦࣔΛग़͢Ϙε ϝΠϯDBͱΓͱΓͰ͖Δ
Worker ࣮ࡍʹಇ͘࿑ಇऀ Controller͔ΒͷࢦࣔͰಇ͘ ඇಉظͰ͕͔͔࣌ؒΔॲཧΛ͜ͳ͢ ऴΘͬͨΒControllerʹใࠂ
Node agent LB nodeʹજΉΤʔδΣϯτ LB nodeͷॳظઃఆ Worker͔ΒͷࢦࣔͰίϚϯυΛ࣮ߦ ֤छϝτϦΫεΛMonitorʹใࠂ
Monitor ࢹ՝ۚॲཧΛߦ͏ݟுΓ Agent͔ΒͷϝτϦΫεΛूܭ Կ͔͋ΕControllerʹใࠂ
Via RabbitMQ શίϯϙʔωϯτ͕RabbitMQܦ༝ͰΓͱΓ 8PSLFS $POUSPMMFS /PEFBHFOU ࢦࣔ ࢦࣔ/ใࠂ ใࠂ ඇಉظ
ಉظ
Good
Scalable! εέʔϧΞτ͕؆୯ • ৽͍͠ίϯϙʔωϯτ͕ͭͳ͗ʹ͍͚ͩ͘ RabbitMQ͕ϘτϧωοΫʹͳΓಘΔʁ • ͠Β͘৺ͳͦ͞͏
RabbitMQ is nice ϧʔςΟϯά͕ॊೈ ͱָͯ: Pub/Subඇಉظॲཧ ͱָͯ: ෛՙࢄ • Producer/ConsumerࣗͰͭͳ͗ʹ͘Δ
• LBͰࢄ͠Α͏ͱ͢Δͱ…
Nice microservices ྑ͍ײ͡ʹίϯϙʔωϯτׂͰ͖ͨ • ׂෛՙ ֤୲ऀͰҰؾʹฒߦ։ൃͰ͖ͨ 1ڞ௨ͷRabbitMQ͕͋Ε݁߹ςετ؆୯ • ϩʔΧϧͱϩʔΧϧΛ؆୯ʹͭͳ͛Δ
Sensu ·͞ʹΫϥυ࣌ͷࢹπʔϧ ͍ͭ͜RabbitMQΛ͏ Pub/SubͰࢹ
Not Good
Bad microservices ͏·͘Θ͚ΒΕͳ͔ͬͨ෦ • MonitorͱControllerͰಉ͡DBΈͯΔ ίϯϙʔωϯτԣஅͰΈΔͱDRY͡Όͳ͍ ΠϯϑϥίετͰ͔͍ • ࣍ίϯςφԽ͍ͨ͠
RPC is not good RPC͍ͬͺ͍ͬͯΔ RabbitMQຊདྷRPC͢Δͷ͡Όͳ͍ ͦΕREST APIͰͰ͖ͳ͍ͷʁ • ͍ɺͰ͖·͢
Insufficient information ใ͕গͳ͍ ެࣜυΩϡϝϯτॆ࣮ • ӳޠΦϯϦʔ
Summary MicroservicesͱPub/SubͰScalableʹʂ✨ MicroservicesͱPub/Subͷ૬ੑΠΠʂ શ෦RabbitMQܦ༝Ͱͳ͘దࡐదॴʹʂʂ
Thank you for your attention MicroservicesͱPub/SubͰScalableʹʂ✨ MicroservicesͱPub/Subͷ૬ੑΠΠʂ શ෦RabbitMQܦ༝Ͱͳ͘దࡐదॴʹʂʂ