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
Goran Jurić
October 26, 2013
Programming
0
290
Skaliranje distribuiranih aplikacija uz pomoć AMQP-a
Goran Jurić
October 26, 2013
Tweet
Share
More Decks by Goran Jurić
See All by Goran Jurić
HAProxy
gjuric
0
1.4k
Doctrine 2
gjuric
0
280
Capistrano iliti kako Rubyem deployati PHP kod
gjuric
0
250
Other Decks in Programming
See All in Programming
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
1
2.1k
Honoアップデート 2025年夏
yusukebe
1
850
Claude Codeで挑むOSSコントリビュート
eycjur
0
180
AHC051解法紹介
eijirou
0
620
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.5k
コーディングは技術者(エンジニア)の嗜みでして / Learning the System Development Mindset from Rock Lady
mackey0225
2
580
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
380
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
190
「リーダーは意思決定する人」って本当?~ 学びを現場で活かす、リーダー4ヶ月目の試行錯誤 ~
marina1017
0
240
Google I/O recap web編 大分Web祭り2025
kponda
0
2.9k
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
990
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
260
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
695
190k
BBQ
matthewcrist
89
9.8k
The Cult of Friendly URLs
andyhume
79
6.5k
Become a Pro
speakerdeck
PRO
29
5.5k
Agile that works and the tools we love
rasmusluckow
329
21k
Documentation Writing (for coders)
carmenintech
73
5k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Why Our Code Smells
bkeepers
PRO
338
57k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Making Projects Easy
brettharned
117
6.3k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
A Tale of Four Properties
chriscoyier
160
23k
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