SlideShare a Scribd company logo
1 of 21
1
going event driven
+ kafka a rabbit-mq
java group #13 bratislava @danielharcek
2
Agenda
1. Case study
2. Retrospektiva
3. Event-driven(ness)
4. Messaging
5. JMS
6. RMQ
7. Kafka
8. Otazky?
3
Pred
l b
w
e
b
rt
rt
rt
rt
rt
rt
r loader
p loader
MySQL
req
multithreaded
daemons
MySQL
prof
I/O
I/O
read
I/O
mov
I/O
mov
networ
k
I/O
write
networ
k
I/O
write
networ
k
reports
campaigns
MySQL
ad
MySQL
sys
reports
aggregate
reports
custom
reports
visiitors
w
e
b
sync
tab delimited files chunked per minute
mostly cron-scheduled once per day
networ
k I/O
write
MySQL
req
archive
4
Po
l b
w
e
b
rt
rt
rt
rt
rt
rt
rabbit
MySQL
req
arch
MySQL
prof
I/O
read
networ
k
I/O
write
networ
k
I/O
write
networ
k
reports
campaigns
MySQL
ad
MySQL
sys
reports
aggregate
reports
custom
reports
visiitors
w
e
b
sync
request sent,
persisted and
forwarded over
network
daemons & batch (cron jobs)
networ
k I/O
write
5
#pred_a_po
rt
rt
rt
rt
rt
rt
r loader
p loader
MySQL
req
MySQL
prof
reports
campaigns
reports
aggregate
reports
custom
reports
visiitors
rabbit
reports
campaigns
reports
aggregate
reports
custom
reports
visiitors
rt
rt
rt
rt
rt
rt
v
e
r
s
u
s
6
Co sme ziskali
• usetrili sme VELA disk i/o
• usetrili load na DB a zredukovali mnozstvo DB
hostov (zostal vlastne uz iba “archiv”
requestov)
• zlepsili distribuovatelnost
• reporty sa stali menej previazane (netrebalo
zdielany diskovy caching)
• moznost jednoduchsie pridavat nove typy
worker reportov
• moznost signalovat potrebu recountu
• skoro-real time countre (predtym
komplikovane koli loadu na DB)
• ak nam padol tracker tak sme nestratili
(takmer) ziadne requesty
• zjednodusila sa nam distribucia a mohli sme
sa viac sustredit na optimalizaciu reportingu
• ak padol report spravy si nan pockaju (to ale
nebol problem predtym)
rabbit
reports
campaigns
reports
aggregate
reports
custom
reports
visiitors
rt
rt
rt
rt
rt
rt
7
“Reaktivita” je dnes proste
KAJŠMENTKE
8
Event-driven(ness)
But now a new architecture has evolved to let developers
conceptualize and build applications that satisfy today’s
demands.
We call these Reactive Applications. This architecture
allows developers to build systems that are event-driven,
scalable, resilient and responsive.
http://www.reactivemanifesto.org/
NIC NOVE!
9
Potreba
Komplexne systemy pracujuce s tokmi
velkeho objemu dat s potrebou
odozvy v takmer realnom case,
“neustalym” uptimom nasadzovane do
cloudoveho prostredia s flexibilnym
modelom skalovania a spravy.
napr. IoT, mobilne appky, automaticke tradingove systemy
10
Messaging 101
Push based (zvacsa)
Producer (agent)
Consumer (sink)
“Event consumers subscribe to middleware which receives notification of an
event from producer(s).”
Vyuziva messaging middleware (backbone)
• vacsinou menej alebo viac sofistikovany Broker (message manager)
• alebo broker-less framework, jednoducho “Queue”* (p2p, napr. ZMQ)
Durability vs. persistence (subscription vs. message)
Garancia radenia (ziadna, FIFO)*
Garancia dorucenia (at-most-once, at-least-once, exactly once)
11
Messaging broker / broker-less
O(n2) O(n)
http://www.eaipatterns.com/ramblings/03_hubandspoke.html
12
Messaging broker / broker-less
broker ako adresar distribuovany broker distribuovany adresar
http://zeromq.org/whitepapers:brokerless
13
Messaging - rozhodujúce kritériá
• potrebna priepustnost (velkost spravy a pocet sprav), latencia
• clustering / HA
• aka topologia (broker, nebroker, aky workflow)
• perzistencia (mat consumerov ktori nie su pern. online)
• moznosti routingu, filtrovania, fransformacie
• push a konzumovania batchov sprav
• delivery a ordering garancie
• “multiplatformovost” (klienti, drivers) a vyspelost
• podpora protokolov
• ttl, delayed / scheduled messages, prioritizacia messagov
• acknowledgment / receipt notification
14
Messaging basic patterns: Queue
• point-to-point
• by default FIFO
• message je spracovany PRAVE
jednym consumerom
• logovanie udalosti / monitoring
• load leveling (cakaju vo fronte tak
ako system stiha)
• load balancing (pridanie novych
async workerov)
producer queue consumer
producer queue consumer
consumer
consumer
15
Messaging basic patterns: Publish-Subscribe
• hub / broadcast
• sprava od publishera je
forwardovana na vsetkych
subscriberov
• * topic
• propagacia udalosti (napr. MMO,
push notifikacie, live updaty skore
zapasu a podobne)
• integracie
producer topic consumer
consumer
consumer
16
Messaging basic patterns: Request-reply
• ring
• blizke RPC
• asynchronne spracovanie
odpovede
• klientska aplikacia posle search
query, backend searchne,
vysledok sa vrati naspat
• aplikacia si vyziada stav inej
aplikacie (napr. progress tasku)
producer
request q
consumer
reply q
17
JMS
• Prva verzia 1.0.2b v 2001, 2.0 v 2013
• Java Message Service API
• MOM rozhranie (Message Oriented Middleware)
• Nepopisuje protokol! (teda dve implementacie JMS nemusia vediet
komunikovat)
• Provider, Client – Producer / Consumer, Message, Queue (per Consumer),
Topic (distribucny mechanizmus)
• Nema garantovany ordering, dorucenie at-most-once alebo once-and-only-
once (ak je message persistentny)
• Point-to-point a Publish-Subscribe
• Implentacie: ActiveMQ, Qpid, Redis, …
18
RMQ
• Vyspely broker (komplexne moznosti routovania, workflows), dokumentacia,
tooling
• AMQP +plugins
• Drivre do vsetkych relevantnych jazykov a kopec pluginov
• Publisher, Exchange, Route, Queue, Consumer
• Echanges: Direct, Fanout, Topic, Headers
• Exchange su by default transientne, ich durabilitu a persistenciu je treba
explicitne deklarovat
• Consumeri maju push aj pull API
• ACK, a volba kedy poslat, nie je 100%, expiracia atd
• pub-sub je Fanout
• clustering, federation (plugin) a queues replication
• Vhodny ak menej ako 20k+/sec* a ak potreba komplexnych routing
scenarov
19
Kafka
• distribuovany pub-sub messaging system, skor klient-server ako broker (urceny pre
konkretny typ use-casov – spracovanie real time aktivity streamov, zber metrik, logovanie)
• 0.8.x, meni sa pod rukami
• klienti pre kazdy relevantny jazyk
• messages su persistovane na servri, kafka zapise a potom zisti kto fetchuje,
konfigurovatelny “rolling window of time” (cas alebo miesto na hdd), jedna kopia stremu pre
N consumerov
• dorucenie v poradi a at-least-once garancia
• producer-centric (t.j. producer si strazi svoj stav – rmq ma metadata na strane brokera
• pull-based (data fetchujeme a mozme aj specifikovat offset – robit rewind)
• Cosumer, producer, topic, partition (ak su consumer groups)
• Potrebuje Zookeeper – distribuovany register / adresar, je pouzity na koordinaciu clustra
producerov, consumerov a “brokera”
• Od 0.8 replikacia partitions, partitioning definovany producerom, Kafka rozhoduje ako
rozhodi partitions na brokerov, aj ACK
• Vhodny ak treba vysoku priepustnost (100k+/sec)*
20
Event-driven(ness)
Umoznuje navrhovat systemy, kde
volne previazane komponenty
(asynchronne) komunikuju
prostrednictvom sprav a takyto
dizajn vediet k implementacii ktora
zjedodusuje rozsirovanie a spravu
systemu.
Pouzitie je teda na distribuciu uloh
(routing), spravu (management)
systemu, transformaciu* a kontrolu
(monitoring).
Asynchronicita umoznuje efektivne
zdielat prostriedky “jedneho HW
vlakna” / vypoctovej jednotky resp.
komunikacneho kanala. Non-
blocking vedie k nizsej latencii a
vyssej priepustnosti. Konkurentnost
priamo v dizajne.
21
Otázky?
deh'-ku-yem
za pozornost
a chlapcom z mrkvosoftu za to ze powerpoint NEMA autosave
recovery-save sa nepocita!

More Related Content

What's hot

Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
Gavin Roy
 
크롬의고성능네트워킹
크롬의고성능네트워킹크롬의고성능네트워킹
크롬의고성능네트워킹
Juhui Park
 
イマドキなNetwork/IO
イマドキなNetwork/IOイマドキなNetwork/IO
イマドキなNetwork/IO
Takuya ASADA
 
The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems
Ioanna Tsalouchidou
 

What's hot (20)

Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Kafka: Internals
Kafka: InternalsKafka: Internals
Kafka: Internals
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
 
MetaCloud Computing Environment
MetaCloud Computing EnvironmentMetaCloud Computing Environment
MetaCloud Computing Environment
 
Understanding kafka
Understanding kafkaUnderstanding kafka
Understanding kafka
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
 
RabbitMQ vs Apache Kafka - Part 1
RabbitMQ vs Apache Kafka - Part 1RabbitMQ vs Apache Kafka - Part 1
RabbitMQ vs Apache Kafka - Part 1
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
 
Rabbitmq & Kafka Presentation
Rabbitmq & Kafka PresentationRabbitmq & Kafka Presentation
Rabbitmq & Kafka Presentation
 
Cpu Caches
Cpu CachesCpu Caches
Cpu Caches
 
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
Kafka meetup JP #3 - Engineering Apache Kafka at LINEKafka meetup JP #3 - Engineering Apache Kafka at LINE
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
 
크롬의고성능네트워킹
크롬의고성능네트워킹크롬의고성능네트워킹
크롬의고성능네트워킹
 
イマドキなNetwork/IO
イマドキなNetwork/IOイマドキなNetwork/IO
イマドキなNetwork/IO
 
Kafka basics
Kafka basicsKafka basics
Kafka basics
 
Kafka Technical Overview
Kafka Technical OverviewKafka Technical Overview
Kafka Technical Overview
 
The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
Linux network stack
Linux network stackLinux network stack
Linux network stack
 

Similar to Going event drive + Kafka a RabbitMQ

Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Joe Stein
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Erik Onnen
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Shameera Rathnayaka
 
[March sn meetup] apache pulsar + apache nifi for cloud data lake
[March sn meetup] apache pulsar + apache nifi for cloud data lake[March sn meetup] apache pulsar + apache nifi for cloud data lake
[March sn meetup] apache pulsar + apache nifi for cloud data lake
Timothy Spann
 
NoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackNoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePack
Sadayuki Furuhashi
 
NoSQL afternoon in Japan kumofs & MessagePack
NoSQL afternoon in Japan kumofs & MessagePackNoSQL afternoon in Japan kumofs & MessagePack
NoSQL afternoon in Japan kumofs & MessagePack
Sadayuki Furuhashi
 

Similar to Going event drive + Kafka a RabbitMQ (20)

Apache Kafka Introduction
Apache Kafka IntroductionApache Kafka Introduction
Apache Kafka Introduction
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
 
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
 
[March sn meetup] apache pulsar + apache nifi for cloud data lake
[March sn meetup] apache pulsar + apache nifi for cloud data lake[March sn meetup] apache pulsar + apache nifi for cloud data lake
[March sn meetup] apache pulsar + apache nifi for cloud data lake
 
NoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackNoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePack
 
NoSQL afternoon in Japan kumofs & MessagePack
NoSQL afternoon in Japan kumofs & MessagePackNoSQL afternoon in Japan kumofs & MessagePack
NoSQL afternoon in Japan kumofs & MessagePack
 
Timothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for MLTimothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for ML
 
Azure Event Hubs - Behind the Scenes With Kasun Indrasiri | Current 2022
Azure Event Hubs - Behind the Scenes With Kasun Indrasiri | Current 2022Azure Event Hubs - Behind the Scenes With Kasun Indrasiri | Current 2022
Azure Event Hubs - Behind the Scenes With Kasun Indrasiri | Current 2022
 
Scalable Web Apps
Scalable Web AppsScalable Web Apps
Scalable Web Apps
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
Architectures with Windows Azure
Architectures with Windows AzureArchitectures with Windows Azure
Architectures with Windows Azure
 
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
 
Multi-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation StrategiesMulti-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation Strategies
 
Distributed messaging with Apache Kafka
Distributed messaging with Apache KafkaDistributed messaging with Apache Kafka
Distributed messaging with Apache Kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 

More from harcek (7)

Minimum viable product 101
Minimum viable product 101Minimum viable product 101
Minimum viable product 101
 
Next 30 Advertising
Next 30 AdvertisingNext 30 Advertising
Next 30 Advertising
 
Next 30 Reklama
Next 30 Reklama Next 30 Reklama
Next 30 Reklama
 
Coursera meetup #2 Learning Languages Online
Coursera meetup #2 Learning Languages OnlineCoursera meetup #2 Learning Languages Online
Coursera meetup #2 Learning Languages Online
 
Coursera.org Zilina meetup #1 MOOC Tips
Coursera.org Zilina meetup #1 MOOC TipsCoursera.org Zilina meetup #1 MOOC Tips
Coursera.org Zilina meetup #1 MOOC Tips
 
Coursera.org Zilina meetup #1 MOOC & online education intro
Coursera.org Zilina meetup #1 MOOC & online education introCoursera.org Zilina meetup #1 MOOC & online education intro
Coursera.org Zilina meetup #1 MOOC & online education intro
 
Node.js moduly a testovanie
Node.js moduly a testovanieNode.js moduly a testovanie
Node.js moduly a testovanie
 

Recently uploaded

Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
gajnagarg
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
amitlee9823
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
gajnagarg
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
gajnagarg
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 

Recently uploaded (20)

Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 

Going event drive + Kafka a RabbitMQ

  • 1. 1 going event driven + kafka a rabbit-mq java group #13 bratislava @danielharcek
  • 2. 2 Agenda 1. Case study 2. Retrospektiva 3. Event-driven(ness) 4. Messaging 5. JMS 6. RMQ 7. Kafka 8. Otazky?
  • 3. 3 Pred l b w e b rt rt rt rt rt rt r loader p loader MySQL req multithreaded daemons MySQL prof I/O I/O read I/O mov I/O mov networ k I/O write networ k I/O write networ k reports campaigns MySQL ad MySQL sys reports aggregate reports custom reports visiitors w e b sync tab delimited files chunked per minute mostly cron-scheduled once per day networ k I/O write MySQL req archive
  • 6. 6 Co sme ziskali • usetrili sme VELA disk i/o • usetrili load na DB a zredukovali mnozstvo DB hostov (zostal vlastne uz iba “archiv” requestov) • zlepsili distribuovatelnost • reporty sa stali menej previazane (netrebalo zdielany diskovy caching) • moznost jednoduchsie pridavat nove typy worker reportov • moznost signalovat potrebu recountu • skoro-real time countre (predtym komplikovane koli loadu na DB) • ak nam padol tracker tak sme nestratili (takmer) ziadne requesty • zjednodusila sa nam distribucia a mohli sme sa viac sustredit na optimalizaciu reportingu • ak padol report spravy si nan pockaju (to ale nebol problem predtym) rabbit reports campaigns reports aggregate reports custom reports visiitors rt rt rt rt rt rt
  • 7. 7 “Reaktivita” je dnes proste KAJŠMENTKE
  • 8. 8 Event-driven(ness) But now a new architecture has evolved to let developers conceptualize and build applications that satisfy today’s demands. We call these Reactive Applications. This architecture allows developers to build systems that are event-driven, scalable, resilient and responsive. http://www.reactivemanifesto.org/ NIC NOVE!
  • 9. 9 Potreba Komplexne systemy pracujuce s tokmi velkeho objemu dat s potrebou odozvy v takmer realnom case, “neustalym” uptimom nasadzovane do cloudoveho prostredia s flexibilnym modelom skalovania a spravy. napr. IoT, mobilne appky, automaticke tradingove systemy
  • 10. 10 Messaging 101 Push based (zvacsa) Producer (agent) Consumer (sink) “Event consumers subscribe to middleware which receives notification of an event from producer(s).” Vyuziva messaging middleware (backbone) • vacsinou menej alebo viac sofistikovany Broker (message manager) • alebo broker-less framework, jednoducho “Queue”* (p2p, napr. ZMQ) Durability vs. persistence (subscription vs. message) Garancia radenia (ziadna, FIFO)* Garancia dorucenia (at-most-once, at-least-once, exactly once)
  • 11. 11 Messaging broker / broker-less O(n2) O(n) http://www.eaipatterns.com/ramblings/03_hubandspoke.html
  • 12. 12 Messaging broker / broker-less broker ako adresar distribuovany broker distribuovany adresar http://zeromq.org/whitepapers:brokerless
  • 13. 13 Messaging - rozhodujúce kritériá • potrebna priepustnost (velkost spravy a pocet sprav), latencia • clustering / HA • aka topologia (broker, nebroker, aky workflow) • perzistencia (mat consumerov ktori nie su pern. online) • moznosti routingu, filtrovania, fransformacie • push a konzumovania batchov sprav • delivery a ordering garancie • “multiplatformovost” (klienti, drivers) a vyspelost • podpora protokolov • ttl, delayed / scheduled messages, prioritizacia messagov • acknowledgment / receipt notification
  • 14. 14 Messaging basic patterns: Queue • point-to-point • by default FIFO • message je spracovany PRAVE jednym consumerom • logovanie udalosti / monitoring • load leveling (cakaju vo fronte tak ako system stiha) • load balancing (pridanie novych async workerov) producer queue consumer producer queue consumer consumer consumer
  • 15. 15 Messaging basic patterns: Publish-Subscribe • hub / broadcast • sprava od publishera je forwardovana na vsetkych subscriberov • * topic • propagacia udalosti (napr. MMO, push notifikacie, live updaty skore zapasu a podobne) • integracie producer topic consumer consumer consumer
  • 16. 16 Messaging basic patterns: Request-reply • ring • blizke RPC • asynchronne spracovanie odpovede • klientska aplikacia posle search query, backend searchne, vysledok sa vrati naspat • aplikacia si vyziada stav inej aplikacie (napr. progress tasku) producer request q consumer reply q
  • 17. 17 JMS • Prva verzia 1.0.2b v 2001, 2.0 v 2013 • Java Message Service API • MOM rozhranie (Message Oriented Middleware) • Nepopisuje protokol! (teda dve implementacie JMS nemusia vediet komunikovat) • Provider, Client – Producer / Consumer, Message, Queue (per Consumer), Topic (distribucny mechanizmus) • Nema garantovany ordering, dorucenie at-most-once alebo once-and-only- once (ak je message persistentny) • Point-to-point a Publish-Subscribe • Implentacie: ActiveMQ, Qpid, Redis, …
  • 18. 18 RMQ • Vyspely broker (komplexne moznosti routovania, workflows), dokumentacia, tooling • AMQP +plugins • Drivre do vsetkych relevantnych jazykov a kopec pluginov • Publisher, Exchange, Route, Queue, Consumer • Echanges: Direct, Fanout, Topic, Headers • Exchange su by default transientne, ich durabilitu a persistenciu je treba explicitne deklarovat • Consumeri maju push aj pull API • ACK, a volba kedy poslat, nie je 100%, expiracia atd • pub-sub je Fanout • clustering, federation (plugin) a queues replication • Vhodny ak menej ako 20k+/sec* a ak potreba komplexnych routing scenarov
  • 19. 19 Kafka • distribuovany pub-sub messaging system, skor klient-server ako broker (urceny pre konkretny typ use-casov – spracovanie real time aktivity streamov, zber metrik, logovanie) • 0.8.x, meni sa pod rukami • klienti pre kazdy relevantny jazyk • messages su persistovane na servri, kafka zapise a potom zisti kto fetchuje, konfigurovatelny “rolling window of time” (cas alebo miesto na hdd), jedna kopia stremu pre N consumerov • dorucenie v poradi a at-least-once garancia • producer-centric (t.j. producer si strazi svoj stav – rmq ma metadata na strane brokera • pull-based (data fetchujeme a mozme aj specifikovat offset – robit rewind) • Cosumer, producer, topic, partition (ak su consumer groups) • Potrebuje Zookeeper – distribuovany register / adresar, je pouzity na koordinaciu clustra producerov, consumerov a “brokera” • Od 0.8 replikacia partitions, partitioning definovany producerom, Kafka rozhoduje ako rozhodi partitions na brokerov, aj ACK • Vhodny ak treba vysoku priepustnost (100k+/sec)*
  • 20. 20 Event-driven(ness) Umoznuje navrhovat systemy, kde volne previazane komponenty (asynchronne) komunikuju prostrednictvom sprav a takyto dizajn vediet k implementacii ktora zjedodusuje rozsirovanie a spravu systemu. Pouzitie je teda na distribuciu uloh (routing), spravu (management) systemu, transformaciu* a kontrolu (monitoring). Asynchronicita umoznuje efektivne zdielat prostriedky “jedneho HW vlakna” / vypoctovej jednotky resp. komunikacneho kanala. Non- blocking vedie k nizsej latencii a vyssej priepustnosti. Konkurentnost priamo v dizajne.
  • 21. 21 Otázky? deh'-ku-yem za pozornost a chlapcom z mrkvosoftu za to ze powerpoint NEMA autosave recovery-save sa nepocita!

Editor's Notes

  1. este dopln impression transfer request-reply (ako tam bol na zaciatku),
  2. message isla len jedna uz Prerabka nie je uplna (prisposobil som ju tak aby niektore aspekty vynikli)
  3. Messaging je vlastne enterprise integration pattern (aj spring integration) JMS Iba stare myslienky aplikovane do sucasneho kontextu nasadenia a vyzadovaných vlastnosti isteho typu aplikacii. Architektura zalozena na vytvarani, detekovani / notifikovani, konzumovani a reagovani na udalosti. Udalost je zmena stavu. Zmena stavu emituje (asynchronnu) spravu – notifikaciu o udalosti. Je komplementárna so SOA.