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
Skaliranje distribuiranih aplikacija uz pomoć A...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Goran Jurić
October 26, 2013
Programming
330
0
Share
Skaliranje distribuiranih aplikacija uz pomoć AMQP-a
Goran Jurić
October 26, 2013
More Decks by Goran Jurić
See All by Goran Jurić
HAProxy
gjuric
0
1.4k
Doctrine 2
gjuric
0
310
Capistrano iliti kako Rubyem deployati PHP kod
gjuric
0
300
Other Decks in Programming
See All in Programming
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
4
680
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
関係性から理解する"同一性"の型用語たち
pvcresin
2
280
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
330
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
460
cloudnative conference 2026 flyle
azihsoyn
1
200
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
1
170
【ディップ|26年新卒研修資料】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
260
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
470
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.7k
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
5
5.8k
今さら聞けないCancellationToken
htkym
0
130
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
300
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
120
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Leo the Paperboy
mayatellez
7
1.8k
Tell your own story through comics
letsgokoyo
1
930
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
180
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
280
Transcript
Skaliranje distribuiranih aplikacija uz pomoć AMQP-‐a Goran
Jurić Webcamp, Zagreb, 2013.
Problem • razmjena podataka između različitih sustava i platformi
• deseci tisuća poruka / sekundi • asinkrono (fire & forget)
Riješenje? • SOAP, REST ? – Ne postoji nativni queing
mehanizam – Zahtijeva poslužitelj na svakoj strani koja prima poruke – Tko odlučuje gdje pojedina poruka mora završiti? – blocking – Što s djelomično isporučenim porukama?
Alternative • Push vs pull • Job queueovi (dostupnost
klijenata, nedostatak naprednih mogućnosti) – Gearman – Resque – Celery – ...
AMQP • Advanced Message Queuing Protocol • Protokol za
razmjenu i queueing poruka • Otvoren standard • OASIS (v1.0)
Tko koristi AMQP • Njemačka burza • JPMorgan •
NASA • RedHat • VMWare • Mozilla • AT&T • NASA • Openstack • Google
Software • Serveri – SwiftMQ – Apache QPID – Apache ActiveMQ – RabbitMQ
RabbitMQ • Erlang aplikacija • Klijenti dostupni u svim
poznatijim programskim jezicima • Web GUI plugin
Nomenklatura • Poruka • Producer • Consumer • Broker
(AMQP server)
Arhitektura
Arhitektura • Connection (TCP) – Jedna konekcija prema brokeru •
Channel – Više kanala prema Exchange-u
Broker • Exchange – Mjesto dostave poruka – Svaka poruka ima
routing ključ • Bindings – Povezuju Echange i Qeue preko binding ključa • Queue – Odredište poruka – Consumer subscribe
Exchange types • Direct • Default • Fanout •
Topic • Header
Direct Exchange • Svaka poruka ima routing ključ •
Queue X se binda na exchange koristeći ključ K • Poruka se dostavlja u Queue X ukoliko je dostavljena na zadani exchange i ima routing ključ K
Default Exchange • Default exchange nema ime • Svaki
kreirani queue je bindan na defaultni exchange preko imena queuea
Fanout Exchange • Poruka se dostavlja u svaki bindani
queue • Ignorira se routing ključ • Idealno za broadcast
Topic Exchange • Dostavlja poruku u jedan ili više
queuova u ovisnosti o routing ključu • Binding ključ – * jedna riječ – # nula ili više riječi – Bez * i # kao Direct exchange
Topic Exchange
RPC • reploy_to header • Client – Privremeni, anonimni i
ekskluzivni queue – Bez exchangea – Routing ključ = ime queue
RPC
Durability • Exchange durability • Queue durability • Message
persistence
Oprez! • Uvijek declareati exchange i queue prije slanja
ili primanja poruka • Persistentcija poruka – Klasična – Transakcijska !!! – Publisher confirm
Priprema
Publisher
Consumer
Enkodiranje poruka • binary blob • serijalizacija • JSON
• MsgPack • XML • Protocol Buffers
Ostalo • Virtual hosts • Visualiser plugin • HTTP
API • HA clustering • Flow control – Per connection – Memory – Disk
Web GUI
Alternativa AMQP-u • ZeroMQ – Low level alternativa – Web scale
(50-100x brži) – TCP sockets na steroidima
Osobna iskustva • 185 poslužitelja • ~ milijardu poruka
u zadnjih 10 mjeseci • 0 crashes • 0 downtime • 0 lost messages
Kontakt •
[email protected]
• @goran_juric