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
Skaliranje distribuiranih aplikacija uz pomoć A...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Goran Jurić
October 26, 2013
Programming
340
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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.5k
Doctrine 2
gjuric
0
340
Capistrano iliti kako Rubyem deployati PHP kod
gjuric
0
310
Other Decks in Programming
See All in Programming
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
440
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
400
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
710
Workers Cache を知る
syumai
0
370
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
最近”作らせてる” ローカルAIアプリの話
akit37
0
480
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Raft: Consensus for Rubyists
vanstee
142
7.8k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.3k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Agile that works and the tools we love
rasmusluckow
331
22k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building Applications with DynamoDB
mza
96
7.2k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Scaling GitHub
holman
464
140k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
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