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

Apache Kafka
Apache KafkaApache Kafka
Apache Kafkaemreakis
 
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 platformsFederico Michele Facca
 
MetaCloud Computing Environment
MetaCloud Computing EnvironmentMetaCloud Computing Environment
MetaCloud Computing EnvironmentARCCN
 
Understanding kafka
Understanding kafkaUnderstanding kafka
Understanding kafkaAmitDhodi
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - KafkaMayank Bansal
 
RabbitMQ vs Apache Kafka - Part 1
RabbitMQ vs Apache Kafka - Part 1RabbitMQ vs Apache Kafka - Part 1
RabbitMQ vs Apache Kafka - Part 1Erlang Solutions
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsGavin Roy
 
Rabbitmq & Kafka Presentation
Rabbitmq & Kafka PresentationRabbitmq & Kafka Presentation
Rabbitmq & Kafka PresentationEmre Gündoğdu
 
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 LINEkawamuray
 
크롬의고성능네트워킹
크롬의고성능네트워킹크롬의고성능네트워킹
크롬의고성능네트워킹Juhui Park
 
イマドキなNetwork/IO
イマドキなNetwork/IOイマドキなNetwork/IO
イマドキなNetwork/IOTakuya ASADA
 
Kafka Technical Overview
Kafka Technical OverviewKafka Technical Overview
Kafka Technical OverviewSylvester John
 
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
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMakerKris Buytaert
 
Linux network stack
Linux network stackLinux network stack
Linux network stackTakuya ASADA
 

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 driven with Kafka and RabbitMQ

Apache Kafka Introduction
Apache Kafka IntroductionApache Kafka Introduction
Apache Kafka IntroductionAmita Mirajkar
 
Apache Kafka
Apache KafkaApache Kafka
Apache KafkaJoe Stein
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPCMax Alexejev
 
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
 
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! ...Trivadis
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQShameera 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 lakeTimothy Spann
 
NoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackNoSQL afternoon in Japan Kumofs & MessagePack
NoSQL afternoon in Japan Kumofs & MessagePackSadayuki Furuhashi
 
NoSQL afternoon in Japan kumofs & MessagePack
NoSQL afternoon in Japan kumofs & MessagePackNoSQL afternoon in Japan kumofs & MessagePack
NoSQL afternoon in Japan kumofs & MessagePackSadayuki Furuhashi
 
Timothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for MLTimothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for MLEdunomica
 
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 2022HostedbyConfluent
 
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 !Guido Schmutz
 
Architectures with Windows Azure
Architectures with Windows AzureArchitectures with Windows Azure
Architectures with Windows AzureDamir Dobric
 
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...Timothy Spann
 
Multi-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation StrategiesMulti-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation StrategiesSagi Brody
 
Distributed messaging with Apache Kafka
Distributed messaging with Apache KafkaDistributed messaging with Apache Kafka
Distributed messaging with Apache KafkaSaumitra Srivastav
 

Similar to Going event driven with Kafka and 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

Minimum viable product 101
Minimum viable product 101Minimum viable product 101
Minimum viable product 101harcek
 
Next 30 Advertising
Next 30 AdvertisingNext 30 Advertising
Next 30 Advertisingharcek
 
Next 30 Reklama
Next 30 Reklama Next 30 Reklama
Next 30 Reklama harcek
 
Coursera meetup #2 Learning Languages Online
Coursera meetup #2 Learning Languages OnlineCoursera meetup #2 Learning Languages Online
Coursera meetup #2 Learning Languages Onlineharcek
 
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 Tipsharcek
 
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 introharcek
 
Node.js moduly a testovanie
Node.js moduly a testovanieNode.js moduly a testovanie
Node.js moduly a testovanieharcek
 

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

Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 

Recently uploaded (20)

Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 

Going event driven with Kafka and 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.