SlideShare a Scribd company logo
Simplify, Isolate and Scale
with RabbitMQ
John Blackmore - @johnblackmore
Message Queues
• Simplify: Reduce Complexity
• Isolate: Decouple Systems
• Scale: Enable Scalability
John Blackmore - @johnblackmore
What is a message queue?
John Blackmore - @johnblackmore
Simple Queue
• Producer sends messages to a queue
• Consumer receives messages from a queue
• Queue buffers messages un8l they are processed
John Blackmore - @johnblackmore
Why is this Useful?
• "Fire and Forget" Commands
• Decoupling Systems
• Asynchronous Processing
• Parallel Processing
• Fault Tolerance
John Blackmore - @johnblackmore
www.rabbitmq.com
John Blackmore - @johnblackmore
RabbitMQ: Exchanges
John Blackmore - @johnblackmore
Exchange Types
Most common Exchange types:
• Direct: Messages are routed to queues along
bindings that exactly match the rou9ng key.
• Fanout: Messages are routed to all bound queues,
rou9ng key ignored.
• Topic: Messages are routed to queues along
bindings that pa@ern match the rou9ng key.
John Blackmore - @johnblackmore
RabbitMQ Examples
github.com/johnblackmore/rabbitmq-examples-php
John Blackmore - @johnblackmore
New User Emails
• As part of new registra0on a welcome email is sent
• Sending the email takes 1-3 seconds on average
• Under high traffic, the web server can max-out
Underlying Problem:
• Sending email can take a long 0me
John Blackmore - @johnblackmore
New User Emails - Exis/ng Code
// register the new user, then send the welcome email
mail('new.user@example.com', 'Welcome to GroupBuyWidgets!', 'Thanks for signing up.');
• Pro: Simple, easy to read
• Con: Takes a long .me, Blocks un.l email is sent
Solu%on:
• Queue the emails for asynchronous processing
John Blackmore - @johnblackmore
New User Emails - Diagram
• Producer: Registra1on Script on Web Server
• Consumer: Background Worker on Applica7on
Server
• Direct Exchange with Single Queue
John Blackmore - @johnblackmore
New User Emails - Producer
use PhpAmqpLibConnectionAMQPStreamConnection;
use PhpAmqpLibMessageAMQPMessage;
// Connect to RabbitMQ and open a channel
$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
// We will push onto the "email" exchange
$channel->exchange_declare('email', 'direct', false, false, false, false, false);
// Compose the message i.e the email.
$payload = json_encode([
'to' => 'new.user@example.com',
'subject' => 'Welcome to GroupBuyWidgets!',
'body' => 'Thanks for signing up.',
]);
// Wrap the payload and publish to the exchange
$message = new AMQPMessage($payload, ['delivery_mode' => 2]);
$channel->basic_publish($message, 'email', 'email.send');
John Blackmore - @johnblackmore
New User Emails - Benchmarks
Apache Benchmark, 100 requests, 5 connec6ons:
Non Queued
==========
Time taken for tests: 41.232 seconds
Requests per second: 2.43 [#/sec] (mean)
Time per request: 2061.575 [ms] (mean)
Queued
======
Time taken for tests: 6.186 seconds
Requests per second: 16.17 [#/sec] (mean)
Time per request: 309.310 [ms] (mean)
John Blackmore - @johnblackmore
Batch Processing Payments
Problem:
• Lots of data records to process.
• Processing is 3me cri3cal.
Solu%on:
• Parallel Processing
• Mul%ple Consumers
John Blackmore - @johnblackmore
Batch Processing Payments
Number of Consumers | Time to Process
-----------------------|----------------------
1 | 4 - 7 Hours
10 | 25 - 40 Minutes
100 | < 4 Minutes
John Blackmore - @johnblackmore
More RabbitMQ Examples
• Publish/Subscribe - Sending the same message to
mul7ple queues.
• Rou7ng & Topic - Receiving messages selec7vely,
or based on a paAern.
• Remote Procedure Calls - Receiving replies using
anonymous exclusive callback queues.
h"p://www.rabbitmq.com/getstarted.html
John Blackmore - @johnblackmore
Ques%ons?
Twi$er: @johnblackmore
Web: johnblackmore.com
Email: john@johnblackmore.com
github.com/johnblackmore/rabbitmq-examples-php
John Blackmore - @johnblackmore
Sources
• RabbitMQ Tutorials
• AMQP 0-9-1 Model Explained
• Ge=ng Started with RabbitMQ and CloudAMQP
• DigitalOcean - Install and Manage RabbitMQ
John Blackmore - @johnblackmore

More Related Content

Viewers also liked

Emergency Rescue Plan for your Gym
Emergency Rescue Plan for your GymEmergency Rescue Plan for your Gym
Emergency Rescue Plan for your Gym
Jim Thomas
 
How the book keeper fucked up my it management jugsummercamp 2016
How the book keeper fucked up my it management   jugsummercamp 2016How the book keeper fucked up my it management   jugsummercamp 2016
How the book keeper fucked up my it management jugsummercamp 2016
Quentin Adam
 
Akka java
Akka javaAkka java
Akka java
dlvladescu
 
Tehilim 929 #19 מזמור טו 201611123 ftw
Tehilim 929 #19 מזמור טו 201611123  ftwTehilim 929 #19 מזמור טו 201611123  ftw
Tehilim 929 #19 מזמור טו 201611123 ftw
Eliyahu Schuman
 
Analytics with Cassandra & Spark
Analytics with Cassandra & SparkAnalytics with Cassandra & Spark
Analytics with Cassandra & Spark
Matthias Niehoff
 
Concurrent and Distributed Applications with Akka, Java and Scala
Concurrent and Distributed Applications with Akka, Java and ScalaConcurrent and Distributed Applications with Akka, Java and Scala
Concurrent and Distributed Applications with Akka, Java and Scala
Fernando Rodriguez
 
It automation & devops - devopsdays istambul 2016
It automation & devops -  devopsdays istambul 2016It automation & devops -  devopsdays istambul 2016
It automation & devops - devopsdays istambul 2016
Quentin Adam
 
Agenda tempatan 21
Agenda tempatan  21Agenda tempatan  21
Agenda tempatan 21
Norsyaza Aqilah
 
Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016
Matthew Broberg
 
Bandar saya (pekan,pahang) dan agenda tempatan
Bandar saya (pekan,pahang) dan agenda tempatanBandar saya (pekan,pahang) dan agenda tempatan
Bandar saya (pekan,pahang) dan agenda tempatan
zaira zue
 
[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유
[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유
[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유
daumfoundation
 
[2016 체인지온] 4차산업혁명의 도전과 기회_이원재
[2016 체인지온] 4차산업혁명의 도전과 기회_이원재[2016 체인지온] 4차산업혁명의 도전과 기회_이원재
[2016 체인지온] 4차산업혁명의 도전과 기회_이원재
daumfoundation
 
我們比我聰明:網路時代的教育與學習
我們比我聰明:網路時代的教育與學習我們比我聰明:網路時代的教育與學習
我們比我聰明:網路時代的教育與學習
順孝 陳
 
ggplot2用例集 入門編
ggplot2用例集 入門編ggplot2用例集 入門編
ggplot2用例集 入門編
nocchi_airport
 
スパースモデリング入門
スパースモデリング入門スパースモデリング入門
スパースモデリング入門
Hideo Terada
 
Deep learning as_WaveExtractor
Deep learning as_WaveExtractorDeep learning as_WaveExtractor
Deep learning as_WaveExtractor
동윤 이
 
Building an AI Startup: Realities & Tactics
Building an AI Startup: Realities & TacticsBuilding an AI Startup: Realities & Tactics
Building an AI Startup: Realities & Tactics
Matt Turck
 
On a connecté le studio !
On a connecté le studio !On a connecté le studio !
On a connecté le studio !
Sameh BEN FREDJ
 
Stanコードの書き方 中級編
Stanコードの書き方 中級編Stanコードの書き方 中級編
Stanコードの書き方 中級編
Hiroshi Shimizu
 
How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity
How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity
How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity
Marketo
 

Viewers also liked (20)

Emergency Rescue Plan for your Gym
Emergency Rescue Plan for your GymEmergency Rescue Plan for your Gym
Emergency Rescue Plan for your Gym
 
How the book keeper fucked up my it management jugsummercamp 2016
How the book keeper fucked up my it management   jugsummercamp 2016How the book keeper fucked up my it management   jugsummercamp 2016
How the book keeper fucked up my it management jugsummercamp 2016
 
Akka java
Akka javaAkka java
Akka java
 
Tehilim 929 #19 מזמור טו 201611123 ftw
Tehilim 929 #19 מזמור טו 201611123  ftwTehilim 929 #19 מזמור טו 201611123  ftw
Tehilim 929 #19 מזמור טו 201611123 ftw
 
Analytics with Cassandra & Spark
Analytics with Cassandra & SparkAnalytics with Cassandra & Spark
Analytics with Cassandra & Spark
 
Concurrent and Distributed Applications with Akka, Java and Scala
Concurrent and Distributed Applications with Akka, Java and ScalaConcurrent and Distributed Applications with Akka, Java and Scala
Concurrent and Distributed Applications with Akka, Java and Scala
 
It automation & devops - devopsdays istambul 2016
It automation & devops -  devopsdays istambul 2016It automation & devops -  devopsdays istambul 2016
It automation & devops - devopsdays istambul 2016
 
Agenda tempatan 21
Agenda tempatan  21Agenda tempatan  21
Agenda tempatan 21
 
Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016
 
Bandar saya (pekan,pahang) dan agenda tempatan
Bandar saya (pekan,pahang) dan agenda tempatanBandar saya (pekan,pahang) dan agenda tempatan
Bandar saya (pekan,pahang) dan agenda tempatan
 
[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유
[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유
[2016 체인지온] 평가없는모금,홍보에서 탈출하기_김자유
 
[2016 체인지온] 4차산업혁명의 도전과 기회_이원재
[2016 체인지온] 4차산업혁명의 도전과 기회_이원재[2016 체인지온] 4차산업혁명의 도전과 기회_이원재
[2016 체인지온] 4차산업혁명의 도전과 기회_이원재
 
我們比我聰明:網路時代的教育與學習
我們比我聰明:網路時代的教育與學習我們比我聰明:網路時代的教育與學習
我們比我聰明:網路時代的教育與學習
 
ggplot2用例集 入門編
ggplot2用例集 入門編ggplot2用例集 入門編
ggplot2用例集 入門編
 
スパースモデリング入門
スパースモデリング入門スパースモデリング入門
スパースモデリング入門
 
Deep learning as_WaveExtractor
Deep learning as_WaveExtractorDeep learning as_WaveExtractor
Deep learning as_WaveExtractor
 
Building an AI Startup: Realities & Tactics
Building an AI Startup: Realities & TacticsBuilding an AI Startup: Realities & Tactics
Building an AI Startup: Realities & Tactics
 
On a connecté le studio !
On a connecté le studio !On a connecté le studio !
On a connecté le studio !
 
Stanコードの書き方 中級編
Stanコードの書き方 中級編Stanコードの書き方 中級編
Stanコードの書き方 中級編
 
How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity
How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity
How to Use ON24 and Marketo to Increase Your Lead Quality and Quantity
 

Similar to Simplify, Isolate and Scale with RabbitMQ

Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Ontico
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHP
Alvaro Videla
 
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
James Titcumb
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Kacper Gunia
 
Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels
Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration ChannelsEfail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels
Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels
Priyanka Aash
 
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
James Titcumb
 
XMPP Intro 1101 - 2008
XMPP Intro 1101 - 2008XMPP Intro 1101 - 2008
XMPP Intro 1101 - 2008
Steffen Larsen
 
Get Started with RabbitMQ (CoderCruise 2017)
Get Started with RabbitMQ (CoderCruise 2017)Get Started with RabbitMQ (CoderCruise 2017)
Get Started with RabbitMQ (CoderCruise 2017)
James Titcumb
 
Massive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on RailsMassive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on Rails
ibelmonte
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmq
Selasie Hanson
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
Eberhard Wolff
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
confluent
 
PHP: Best Mailing Practices
PHP: Best Mailing PracticesPHP: Best Mailing Practices
PHP: Best Mailing Practices
webhostingguy
 
PHP: Best Mailing Practices
PHP: Best Mailing PracticesPHP: Best Mailing Practices
PHP: Best Mailing Practices
webhostingguy
 
PHP: Best Mailing Practices
PHP: Best Mailing PracticesPHP: Best Mailing Practices
PHP: Best Mailing Practices
webhostingguy
 
What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)
James Titcumb
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
Ortus Solutions, Corp
 
Mastering message queues | Tobias Nyholm | CODEiD
Mastering message queues | Tobias Nyholm | CODEiDMastering message queues | Tobias Nyholm | CODEiD
Mastering message queues | Tobias Nyholm | CODEiD
CODEiD PHP Community
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQAlvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Tanya Denisyuk
 
Kafka Reliability - When it absolutely, positively has to be there
Kafka Reliability - When it absolutely, positively has to be thereKafka Reliability - When it absolutely, positively has to be there
Kafka Reliability - When it absolutely, positively has to be there
Gwen (Chen) Shapira
 

Similar to Simplify, Isolate and Scale with RabbitMQ (20)

Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHP
 
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
 
Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels
Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration ChannelsEfail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels
Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels
 
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
 
XMPP Intro 1101 - 2008
XMPP Intro 1101 - 2008XMPP Intro 1101 - 2008
XMPP Intro 1101 - 2008
 
Get Started with RabbitMQ (CoderCruise 2017)
Get Started with RabbitMQ (CoderCruise 2017)Get Started with RabbitMQ (CoderCruise 2017)
Get Started with RabbitMQ (CoderCruise 2017)
 
Massive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on RailsMassive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on Rails
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmq
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
 
PHP: Best Mailing Practices
PHP: Best Mailing PracticesPHP: Best Mailing Practices
PHP: Best Mailing Practices
 
PHP: Best Mailing Practices
PHP: Best Mailing PracticesPHP: Best Mailing Practices
PHP: Best Mailing Practices
 
PHP: Best Mailing Practices
PHP: Best Mailing PracticesPHP: Best Mailing Practices
PHP: Best Mailing Practices
 
What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)What RabbitMQ can do for you (phpnw14 Uncon)
What RabbitMQ can do for you (phpnw14 Uncon)
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
 
Mastering message queues | Tobias Nyholm | CODEiD
Mastering message queues | Tobias Nyholm | CODEiDMastering message queues | Tobias Nyholm | CODEiD
Mastering message queues | Tobias Nyholm | CODEiD
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQAlvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
 
Kafka Reliability - When it absolutely, positively has to be there
Kafka Reliability - When it absolutely, positively has to be thereKafka Reliability - When it absolutely, positively has to be there
Kafka Reliability - When it absolutely, positively has to be there
 

More from TechExeter

Exeter Science Centre, by Natalie Whitehead
Exeter Science Centre, by Natalie WhiteheadExeter Science Centre, by Natalie Whitehead
Exeter Science Centre, by Natalie Whitehead
TechExeter
 
South West InternetOfThings Network by Wo King
South West InternetOfThings Network by Wo KingSouth West InternetOfThings Network by Wo King
South West InternetOfThings Network by Wo King
TechExeter
 
Generative Adversarial Networks by Tariq Rashid
Generative Adversarial Networks by Tariq RashidGenerative Adversarial Networks by Tariq Rashid
Generative Adversarial Networks by Tariq Rashid
TechExeter
 
Conf 2019 - Workshop: Liam Glanfield - know your threat actor
Conf 2019 - Workshop: Liam Glanfield - know your threat actorConf 2019 - Workshop: Liam Glanfield - know your threat actor
Conf 2019 - Workshop: Liam Glanfield - know your threat actor
TechExeter
 
Conf 2018 Track 1 - Unicorns aren't real
Conf 2018 Track 1 - Unicorns aren't realConf 2018 Track 1 - Unicorns aren't real
Conf 2018 Track 1 - Unicorns aren't real
TechExeter
 
Conf 2018 Track 1 - Aerospace Innovation
Conf 2018 Track 1 - Aerospace InnovationConf 2018 Track 1 - Aerospace Innovation
Conf 2018 Track 1 - Aerospace Innovation
TechExeter
 
Conf 2018 Track 2 - Try Elm
Conf 2018 Track 2 - Try ElmConf 2018 Track 2 - Try Elm
Conf 2018 Track 2 - Try Elm
TechExeter
 
Conf 2018 Track 3 - Creating marine geospatial services
Conf 2018 Track 3 - Creating marine geospatial servicesConf 2018 Track 3 - Creating marine geospatial services
Conf 2018 Track 3 - Creating marine geospatial services
TechExeter
 
Conf 2018 Track 2 - Machine Learning with TensorFlow
Conf 2018 Track 2 - Machine Learning with TensorFlowConf 2018 Track 2 - Machine Learning with TensorFlow
Conf 2018 Track 2 - Machine Learning with TensorFlow
TechExeter
 
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilConf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
TechExeter
 
Conf 2018 Track 1 - Tessl / revolutionising the house moving process
Conf 2018 Track 1 - Tessl / revolutionising the house moving processConf 2018 Track 1 - Tessl / revolutionising the house moving process
Conf 2018 Track 1 - Tessl / revolutionising the house moving process
TechExeter
 
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UKConf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
TechExeter
 
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
TechExeter
 
Gps behaving badly - Guy Busenel
Gps behaving badly - Guy BusenelGps behaving badly - Guy Busenel
Gps behaving badly - Guy Busenel
TechExeter
 
Why Isn't My Query Using an Index?: An Introduction to SQL Performance
Why Isn't My Query Using an Index?: An Introduction to SQL Performance Why Isn't My Query Using an Index?: An Introduction to SQL Performance
Why Isn't My Query Using an Index?: An Introduction to SQL Performance
TechExeter
 
Turning Developers into Testers
Turning Developers into TestersTurning Developers into Testers
Turning Developers into Testers
TechExeter
 
Remote working
Remote workingRemote working
Remote working
TechExeter
 
Developing an Agile Mindset
Developing an Agile Mindset Developing an Agile Mindset
Developing an Agile Mindset
TechExeter
 
Think like a gardener
Think like a gardenerThink like a gardener
Think like a gardener
TechExeter
 
The trials and tribulations of providing engineering infrastructure
 The trials and tribulations of providing engineering infrastructure  The trials and tribulations of providing engineering infrastructure
The trials and tribulations of providing engineering infrastructure
TechExeter
 

More from TechExeter (20)

Exeter Science Centre, by Natalie Whitehead
Exeter Science Centre, by Natalie WhiteheadExeter Science Centre, by Natalie Whitehead
Exeter Science Centre, by Natalie Whitehead
 
South West InternetOfThings Network by Wo King
South West InternetOfThings Network by Wo KingSouth West InternetOfThings Network by Wo King
South West InternetOfThings Network by Wo King
 
Generative Adversarial Networks by Tariq Rashid
Generative Adversarial Networks by Tariq RashidGenerative Adversarial Networks by Tariq Rashid
Generative Adversarial Networks by Tariq Rashid
 
Conf 2019 - Workshop: Liam Glanfield - know your threat actor
Conf 2019 - Workshop: Liam Glanfield - know your threat actorConf 2019 - Workshop: Liam Glanfield - know your threat actor
Conf 2019 - Workshop: Liam Glanfield - know your threat actor
 
Conf 2018 Track 1 - Unicorns aren't real
Conf 2018 Track 1 - Unicorns aren't realConf 2018 Track 1 - Unicorns aren't real
Conf 2018 Track 1 - Unicorns aren't real
 
Conf 2018 Track 1 - Aerospace Innovation
Conf 2018 Track 1 - Aerospace InnovationConf 2018 Track 1 - Aerospace Innovation
Conf 2018 Track 1 - Aerospace Innovation
 
Conf 2018 Track 2 - Try Elm
Conf 2018 Track 2 - Try ElmConf 2018 Track 2 - Try Elm
Conf 2018 Track 2 - Try Elm
 
Conf 2018 Track 3 - Creating marine geospatial services
Conf 2018 Track 3 - Creating marine geospatial servicesConf 2018 Track 3 - Creating marine geospatial services
Conf 2018 Track 3 - Creating marine geospatial services
 
Conf 2018 Track 2 - Machine Learning with TensorFlow
Conf 2018 Track 2 - Machine Learning with TensorFlowConf 2018 Track 2 - Machine Learning with TensorFlow
Conf 2018 Track 2 - Machine Learning with TensorFlow
 
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilConf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
 
Conf 2018 Track 1 - Tessl / revolutionising the house moving process
Conf 2018 Track 1 - Tessl / revolutionising the house moving processConf 2018 Track 1 - Tessl / revolutionising the house moving process
Conf 2018 Track 1 - Tessl / revolutionising the house moving process
 
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UKConf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
Conf 2018 Keynote - Andy Stanford-Clark, CTO IBM UK
 
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
Conf 2018 Track 3 - Microservices - What I've learned after a year building s...
 
Gps behaving badly - Guy Busenel
Gps behaving badly - Guy BusenelGps behaving badly - Guy Busenel
Gps behaving badly - Guy Busenel
 
Why Isn't My Query Using an Index?: An Introduction to SQL Performance
Why Isn't My Query Using an Index?: An Introduction to SQL Performance Why Isn't My Query Using an Index?: An Introduction to SQL Performance
Why Isn't My Query Using an Index?: An Introduction to SQL Performance
 
Turning Developers into Testers
Turning Developers into TestersTurning Developers into Testers
Turning Developers into Testers
 
Remote working
Remote workingRemote working
Remote working
 
Developing an Agile Mindset
Developing an Agile Mindset Developing an Agile Mindset
Developing an Agile Mindset
 
Think like a gardener
Think like a gardenerThink like a gardener
Think like a gardener
 
The trials and tribulations of providing engineering infrastructure
 The trials and tribulations of providing engineering infrastructure  The trials and tribulations of providing engineering infrastructure
The trials and tribulations of providing engineering infrastructure
 

Recently uploaded

Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
SubhamMandal40
 
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
alexjohnson7307
 
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
sunilverma7884
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Kunal Gupta
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
Shiv Technolabs
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
softsuave
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
AmandaCheung15
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
bhumivarma35300
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
Ivanti
 
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
Priyanka Aash
 
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
Priyanka Aash
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Torry Harris
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
SAI KAILASH R
 
Uncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in LibrariesUncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in Libraries
Brian Pichman
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
bellared2
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
alexjohnson7307
 
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
aslasdfmkhan4750
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
BrainSell Technologies
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
Steven Carlson
 

Recently uploaded (20)

Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
 
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
leewayhertz.com-Generative AI tech stack Frameworks infrastructure models and...
 
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
 
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
 
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
 
Uncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in LibrariesUncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in Libraries
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
 
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
 

Simplify, Isolate and Scale with RabbitMQ

  • 1. Simplify, Isolate and Scale with RabbitMQ John Blackmore - @johnblackmore
  • 2. Message Queues • Simplify: Reduce Complexity • Isolate: Decouple Systems • Scale: Enable Scalability John Blackmore - @johnblackmore
  • 3. What is a message queue? John Blackmore - @johnblackmore
  • 4. Simple Queue • Producer sends messages to a queue • Consumer receives messages from a queue • Queue buffers messages un8l they are processed John Blackmore - @johnblackmore
  • 5. Why is this Useful? • "Fire and Forget" Commands • Decoupling Systems • Asynchronous Processing • Parallel Processing • Fault Tolerance John Blackmore - @johnblackmore
  • 8. Exchange Types Most common Exchange types: • Direct: Messages are routed to queues along bindings that exactly match the rou9ng key. • Fanout: Messages are routed to all bound queues, rou9ng key ignored. • Topic: Messages are routed to queues along bindings that pa@ern match the rou9ng key. John Blackmore - @johnblackmore
  • 10. New User Emails • As part of new registra0on a welcome email is sent • Sending the email takes 1-3 seconds on average • Under high traffic, the web server can max-out Underlying Problem: • Sending email can take a long 0me John Blackmore - @johnblackmore
  • 11. New User Emails - Exis/ng Code // register the new user, then send the welcome email mail('new.user@example.com', 'Welcome to GroupBuyWidgets!', 'Thanks for signing up.'); • Pro: Simple, easy to read • Con: Takes a long .me, Blocks un.l email is sent Solu%on: • Queue the emails for asynchronous processing John Blackmore - @johnblackmore
  • 12. New User Emails - Diagram • Producer: Registra1on Script on Web Server • Consumer: Background Worker on Applica7on Server • Direct Exchange with Single Queue John Blackmore - @johnblackmore
  • 13. New User Emails - Producer use PhpAmqpLibConnectionAMQPStreamConnection; use PhpAmqpLibMessageAMQPMessage; // Connect to RabbitMQ and open a channel $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest'); $channel = $connection->channel(); // We will push onto the "email" exchange $channel->exchange_declare('email', 'direct', false, false, false, false, false); // Compose the message i.e the email. $payload = json_encode([ 'to' => 'new.user@example.com', 'subject' => 'Welcome to GroupBuyWidgets!', 'body' => 'Thanks for signing up.', ]); // Wrap the payload and publish to the exchange $message = new AMQPMessage($payload, ['delivery_mode' => 2]); $channel->basic_publish($message, 'email', 'email.send'); John Blackmore - @johnblackmore
  • 14. New User Emails - Benchmarks Apache Benchmark, 100 requests, 5 connec6ons: Non Queued ========== Time taken for tests: 41.232 seconds Requests per second: 2.43 [#/sec] (mean) Time per request: 2061.575 [ms] (mean) Queued ====== Time taken for tests: 6.186 seconds Requests per second: 16.17 [#/sec] (mean) Time per request: 309.310 [ms] (mean) John Blackmore - @johnblackmore
  • 15. Batch Processing Payments Problem: • Lots of data records to process. • Processing is 3me cri3cal. Solu%on: • Parallel Processing • Mul%ple Consumers John Blackmore - @johnblackmore
  • 16. Batch Processing Payments Number of Consumers | Time to Process -----------------------|---------------------- 1 | 4 - 7 Hours 10 | 25 - 40 Minutes 100 | < 4 Minutes John Blackmore - @johnblackmore
  • 17. More RabbitMQ Examples • Publish/Subscribe - Sending the same message to mul7ple queues. • Rou7ng & Topic - Receiving messages selec7vely, or based on a paAern. • Remote Procedure Calls - Receiving replies using anonymous exclusive callback queues. h"p://www.rabbitmq.com/getstarted.html John Blackmore - @johnblackmore
  • 18. Ques%ons? Twi$er: @johnblackmore Web: johnblackmore.com Email: john@johnblackmore.com github.com/johnblackmore/rabbitmq-examples-php John Blackmore - @johnblackmore
  • 19. Sources • RabbitMQ Tutorials • AMQP 0-9-1 Model Explained • Ge=ng Started with RabbitMQ and CloudAMQP • DigitalOcean - Install and Manage RabbitMQ John Blackmore - @johnblackmore