SlideShare uma empresa Scribd logo
1 de 90
Baixar para ler offline
Thursday, July 25, 13
Hi All. As a warning, those of you with previous RabbitMQ experience may find this a bit boring, as it’s an intro
-I won’t try to make anyone guess what this is
-I should explain it a bit, as I’ll be following a similar format for other diagrams.
-Blue symbol represents some feature - browsing, managing, payments, cart
-black box is a single web node or application
-cloud is internet
https://github.com/spember/gr8conf2013-mq-consumer
Thursday, July 25, 13
Make sure to run-app so it grabs all the dependencies
Message Oriented
Architecture with
Rabbit MQ
Steve Pember
Today, 2013
Thursday, July 25, 13
Let’s talk about complexity and scalability
A Few Questions
Thursday, July 25, 13
-A few questions, before we begin.
-I’d like for you to keep the answers to these in your head as we go along
Have you ever...
Wondered why your company’s
codebase is all in one repo?
Thursday, July 25, 13
-or rather, is everything in trunk / master?
-Have you ever had to find the needle in that giant haystack?
Have you ever...
thought “why are there so many
#@$!% tables in this database?
Thursday, July 25, 13
Have you ever...
Dreaded executing
the unit test suite?
Thursday, July 25, 13
-do you miss TDD?
Maybe delete this one
Have you ever...
Gone through a major
refactoring of your app?
Thursday, July 25, 13
whether it be a total overhaul or just a few features.
Have you ever...
Adjusted config files to
ensure a Quartz job runs only on
one load-balanced node?
Thursday, July 25, 13
A little esoteric, but.
With “Traditional” Monolithic Architecture,
One can Reach MVP quickly.
Thursday, July 25, 13
The entirety of the application’s functionality
is in one convenient location.
Thursday, July 25, 13
But that’s it.
Thursday, July 25, 13
Thursday, July 25, 13
The Complexity will become enormous. Any gains you think you may have made at the outset
will not continue, particularly once you start to attract users.
And grow your team.
Won’t scale?
WAIT!
Thursday, July 25, 13
You may say to yourself, “Wait, Steve!” what do you mean it won’t scale?
Thursday, July 25, 13
I can load balance my nodes...
Thursday, July 25, 13
Swimlanes, master-slave dbs in case that doesn’t work
-or add caching in between my nodes
...Sure, but that’s not what I mean.
Thursday, July 25, 13
Normal?
Thursday, July 25, 13
Can you really look at a class diagram like this and really think, “Yeah, that’s awesome. Nailed
it.”?
-this was the largest I could find on Google images. I’m sure we’ve all seen the massive
versions of this that cover multiple pages, taped to the wall.
Thursday, July 25, 13
The ability to add new features, fix bugs, or resolve technical debt cannot scale with the size
of the application. Throwing more developers at it also will not help
- One of the best passive-aggressive statements I’ve seen
- Passive aggressively scrawled on the wall: You can’t make a baby in 1 month with 9 women.
Thursday, July 25, 13
-And trying to refactor anything?
Thursday, July 25, 13
This has been known for some time, and there’s been papers written on the subject.
Although it’s difficult to measure this.
Redacted Client Name:
A Case Study
Thursday, July 25, 13
I’m generally very discrete and don’t mention clients names, especially in presentations, but
they explicitly asked me to do this.
* Still, redacted it
Thursday, July 25, 13
The client was/is a lifestyle brand site. I bit like pintrest
-can share, rate, comment on other peoples style. See what’s trendy.
-I don’t exactly understand the ‘lifestyle’ term
-most importantly, it’s a Grails application
Thursday, July 25, 13
Even have some of these ‘lifestyle’ (I don’t get the term) celebreties come in and create
custom collections of things to share
Thursday, July 25, 13
-we / Cantina were brought in to help recover the application from a remote team.
Development had stalled.
-the remote team had constructed the application in your traditional sense. (Incidentally, they
were making heavy use of Mixins - mixins depending on other mixins - in a large spider web.
One change caused dozens and dozens of file compilations. Cautionary tale!)
Thursday, July 25, 13
When we first started working on it, this is the basic setup for client. A single monolithic .war
file
-Product Browsing/ Catalog (Key feature)
-Product Curation
-User metrics
-Social Graph
-notifications
<sarcasm>Luckily</sarcasm>
everything was writing and
reading from the same DB.
Thursday, July 25, 13
-mention the high-rate rate of the stats
Each feature set ran on each node.
Thursday, July 25, 13
Thursday, July 25, 13
-As you might expect, the original team setup multiple instances of the app and load
balanced it.
-
Heavy caching and balancing
mitigated the problems...
... but still under-performant and
cumbersome to work with.
Thursday, July 25, 13
We added some distributed caching (love ehCache, btw) and few more nodes to the load
balancer in order to get some initial wins...
-but it wasn’t enough, and very difficult to work with
...and the product owner had
ambitious goals
Thursday, July 25, 13
Don’t they always?
Performance and time
hindered growth
Thursday, July 25, 13
-The growth of the product was hindered by the classic duo of performance and time.
-The site could hardly handle the current traffic.
-Member Growth was good, but not good enough.
Thursday, July 25, 13
We didn’t want to go down that same old route.
-Second thing we did was take a step back and look at their current setup.
Enter SOA
Thursday, July 25, 13
-our first tactic was to embrace Service Oriented Architecture (that’s what the SOA stands for)
-Is everyone familiar with it?
-
Thursday, July 25, 13
-Let’s take our anecdotal design, an e-commerce store.
Thursday, July 25, 13
With SOA, one would break up each individual component, and setup communication
between each service over some direct service calls. Eg SOAP or REST.
-Synchronous
Thursday, July 25, 13
Which keeps the individual components easier to manage and keep track of
Decoupling your app into disparate
services keeps complexity down...
Thursday, July 25, 13
... which creates faster, leaner code ...
Thursday, July 25, 13
... which results in rapid long-term
development time...
Thursday, July 25, 13
... and easier code maintainability...
Thursday, July 25, 13
... which saves you Money.
Thursday, July 25, 13
and other numbers that managers love
Also, it’s fun! l
Thursday, July 25, 13
Separation of Concerns is a Good Thing.
Thursday, July 25, 13
possibly delete
However.
Thursday, July 25, 13
There’s always a downside, eh?
Thursday, July 25, 13
I don’t know who that is, but hold on.
I was told he’s kind of a big deal.
Following this approach requires an
architect to drive the distributed vision
and keep folks in line. Y
Thursday, July 25, 13
- I can’t stress this enough. Really gotta own it
There’s some non-trivial upfront time
investing in a service communication
format.
Thursday, July 25, 13
-find out how each will communicate
Intra-Service communication has a cost,
particularly if it’s synchronous.
Thursday, July 25, 13
The services
Thursday, July 25, 13
* Having a web of interconnected services can also grow out of control. Having to configure
service nodes so that each knows where the others are located in the network can be
cumbersome to manage.
*There are tools to help with this, of course. There’s a tool that Twitter released called
‘Figment’ for th
*Also, ESB! Enterprise Service Bus, or even an EMB Messaging Bus.
*but that adds another layer and potential communication step, although it’s necessary for
larger SOA implementations for versioning and management. A bit more on that later.
The ‘D’ stands for ‘Decoupled’.
Heavily Decoupled.
Enter MODA
Thursday, July 25, 13
-Message Oriented
Thursday, July 25, 13
Your basic approach. A single Producer, a Queue of Messages, and a Consumer. In this case,
quite the prodigious one.
Note the queue backup. He should probably share.
Route Messages asynchronously through
a message queue when data needs
processing
Thursday, July 25, 13
The key to a message oriented approach is when certain events occur to encapsulate data
into individual messages and drop them on some queue or exchange
Event-based instead of Procedural
Thursday, July 25, 13
RESTful Messages and Events...
... Consumers only operate on data in the
Message.
Thursday, July 25, 13
TODO: Image of Postman / message. Only operating on the one thing
Add additional nodes to handle load
without additional configuration
Thursday, July 25, 13
Thursday, July 25, 13
-Example from before, an e-commerce site
-we’ve broken the features into individual applications and spun up one node per each
-connected the users’ cart to a queue, and our order processing into another queue
Thursday, July 25, 13
-suppose the cart and order processing start experiencing heavy load
- programatically spin up new instances and you’re good
-
Additional Decoupling
{ Time
w Location
u Cardinality
Thursday, July 25, 13
TIME: Asynchronous
Location: Nodes do not care where the other nodes are, only worry about the broker
Cardinality: Nodes do not care about the number of listenersof their messages
Data Processing: Use a Message!
Data Request: Consider a Service Request
Thursday, July 25, 13
Not everything needs to be a message. I argue that a good rule of thumb for a specific event
to be a candidate for Message Enqueuing is anything that requires some processing to be
done on the event, may require a database write, and can get away with being synchronous.
Frankly, anything that’s not saving User Monetary information or dealing with some govt
regulation is a good candidate.
Now, if you only need to grab some data that’s in another service, you may be able to get
away with a direct request.
Consider using the Events Push plugin and
Async to handle responses for the client
Thursday, July 25, 13
Jump back a few slides to comment
But which Broker to pick?
Thursday, July 25, 13
Thursday, July 25, 13
Rabbit MQ
Language Agnostic (additional decoupling)
Message Persistence
Message Recovery
Thursday, July 25, 13
Thursday, July 25, 13
Slower than other Brokers due to the
amazing features.
Thursday, July 25, 13
Especially with Persistence
Thursday, July 25, 13
spember@cantina.co
@svpember
Thursday, July 25, 13
If you’re struggling to process 4k+ messages/ second, that sounds like an awesome
engineering problem and you contact me.
Thursday, July 25, 13
And finally, there’s a fantastic plugin written by Peter Ledbrook and Jeff Brown
-Why wouldn’t I choose ActiveMQ? You can’t go wrong, really, if you choose to use that
instead.
-ActiveMQ plugin isn’t as well maintained as rabbits’. Author says ActiveMQ isn’t “production
ready”
... but what about ActiveMQ?
Thursday, July 25, 13
This question comes up often.
-Overall, you can’t go wrong with ActiveMQ
-supports many of the same features as Rabbit, with similar performance
-but, clients do not exist for it in as many languages as Rabbit
-Minor point: based on JMS
...but...
Thursday, July 25, 13
... The grails plugin isn’t ready yet.
...What about an Enterprise Service Bus?
Thursday, July 25, 13
*Some of you have been thinking, “waiiiiitttt... what about just using an ESB?”
* Can use one without the other, rabbit would make an excellent addition, working together
* Creating an ESB with rabbit would be another talk entirely, I think.
* Would be happy to discuss this afterwords!
Leaping* Into
Rabbit MQ
*I’m sorry.
Thursday, July 25, 13
Thursday, July 25, 13
The previous description of message queues glosses over what is happening a bit.
-Messages are routed through an EXCHANGE in to one or many queues.
-Messages are then plucked off the queue by an attached, waiting Consumer. Or, the first
available if multiple are attached.
-Exchanges can have different delivery techniques.
Thursday, July 25, 13
If a message is mishandled or the consumer crashes / has an error during message
processing, message is returned to the queue for another consumer to pick it up or try again
Thursday, July 25, 13
Furthermore, Queues and exchanges can be made “durable”, meaning they’ll survive a restart
or server crash with messages intact
Thursday, July 25, 13
RabbitMQ nodes can be clustered
-federated-> shared / copied
-shoveled -> pushed
Thursday, July 25, 13
There are several message delivery strategies one can set up for their exchanges
Thursday, July 25, 13
With the whole purpose of scaring you, here’s the Topic Queue, the most complicated
-gets complicated
-allows for all sorts of wild routing schemes
-all messages go to the BACK of the queue
Thursday, July 25, 13
-may be the most useful, I think
Thursday, July 25, 13
Work Queue
Thursday, July 25, 13
-Work queues operate on a first-come-first serve approach
-I think this is the coolest, one can monitor the state of the exchange and programmatically
spin up or down the number of consumer nodes
-All of these consumers are peers...
Work Queues will likely be your default
pattern
Thursday, July 25, 13
Thursday, July 25, 13
-Finally, there’s ‘fanout’, which distributes a single message to all attached queues. Good for
a general broadcast notification / pub-sub to all your nodes.
-there needs to be a one-to-one queue to consumer relation, though, I believe.
-A special use, case, really.
Back to the Story
Thursday, July 25, 13
Anyway, back to the story
A Sample Diagram:
Thursday, July 25, 13
Back to the redacted client. How’d we end up doing it?
Thursday, July 25, 13
-describe each node
-using only two developers
-in addition, they built the browsing as a SPA, and built a native iPhone app against the
resulting API
Now, Pray to the demo gods.
Thursday, July 25, 13
Thank You!
Questions?
Thursday, July 25, 13
Image Credits
Complexity (pipes): http://www.flickr.com/photos/bhophoto/384574407/
Simple Pipeline: http://tierracos.com/our-companies/tierra-pipeline/
Highway: http://farnorthdallas.advocatemag.com/wp-content/uploads/2013/04/882349_500402383328407_539732406_o.jpg
Homer & doughnuts: http://thechurchillreview.blogspot.com/2012/10/feeling-terror-too-young-aka-kiddie.html
Tom Brady: http://stamperdad.wordpress.com/category/tom-brady/
Telephone Exchange Operator: http://fineartamerica.com/featured/telephone-exchange-1920s-granger.html
People in Queue: http://www.guardian.co.uk/money/2010/mar/23/dole-queue-jobseekers-online
Cookie Monster: http://muppet.wikia.com/wiki/Cookie_Monster_Through_the_Years
Scrooge McDuck: http://smallbusiness.uprinting.com/how-pennies-are-hurting-small-business/
Too Many Cooks: http://www.ecommercesystems.com/featured-articles/cooks-kitchen-driving-ecommerce-business/
Clustered Macs: http://www.uiowa.edu/mihpclab/micg.html
Resuscitate: http://www.dailymail.co.uk/health/article-2034160/Do-resuscitate-Theyre-fateful-words-meaning-doctors-wont-try-save-
you-collapse-hospital.html
Iron Man: http://images.wikia.com/marvelmovies
Mail Sorting: http://riversidechamber.files.wordpress.com
Thursday, July 25, 13

Mais conteúdo relacionado

Semelhante a Message Oriented Architecture - Gr8conf US 2013

Real Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakReal Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakEast Bay WordPress Meetup
 
Reactive design: languages, and paradigms
Reactive design: languages, and paradigmsReactive design: languages, and paradigms
Reactive design: languages, and paradigmsDean Wampler
 
Omega From Download to Layout in 45 min
Omega From Download to Layout in 45 min Omega From Download to Layout in 45 min
Omega From Download to Layout in 45 min Phase2
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programmingMichael Neale
 
How, When, and Why to Patch a Module
How, When, and Why to Patch a Module How, When, and Why to Patch a Module
How, When, and Why to Patch a Module Phase2
 
Wagner whats buggingyou-voyager
Wagner whats buggingyou-voyagerWagner whats buggingyou-voyager
Wagner whats buggingyou-voyagerENUG
 
Upgrading your site from Drupal 6 to Drupal 7
Upgrading your site from Drupal 6 to Drupal 7Upgrading your site from Drupal 6 to Drupal 7
Upgrading your site from Drupal 6 to Drupal 7Andrew Martha
 
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal introEdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal introBryan Ollendyke
 
We4IT lcty 2013 - keynote - worst practices - the best of the worst
We4IT lcty 2013 - keynote - worst practices - the best of the worstWe4IT lcty 2013 - keynote - worst practices - the best of the worst
We4IT lcty 2013 - keynote - worst practices - the best of the worstWe4IT Group
 
Shut Up And Eat Your Veg
Shut Up And Eat Your VegShut Up And Eat Your Veg
Shut Up And Eat Your VegGarth Gilmour
 
Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...
Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...
Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...Citrix
 
Old Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big Bang
Old Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big BangOld Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big Bang
Old Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big BangCristina Ruth
 
Happy Content Creators
Happy Content CreatorsHappy Content Creators
Happy Content CreatorsEric Aitala
 
Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIJoel Byler
 
Unleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineUnleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineKenneth Kalmer
 
The Future is Responsive
The Future is ResponsiveThe Future is Responsive
The Future is ResponsiveJonathan Smiley
 
AtlasCamp 2013: ADG / Lean UX
AtlasCamp 2013: ADG / Lean UXAtlasCamp 2013: ADG / Lean UX
AtlasCamp 2013: ADG / Lean UXcolleenfry
 

Semelhante a Message Oriented Architecture - Gr8conf US 2013 (20)

Real Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakReal Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan Didak
 
Reactive design: languages, and paradigms
Reactive design: languages, and paradigmsReactive design: languages, and paradigms
Reactive design: languages, and paradigms
 
Omega From Download to Layout in 45 min
Omega From Download to Layout in 45 min Omega From Download to Layout in 45 min
Omega From Download to Layout in 45 min
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programming
 
How, When, and Why to Patch a Module
How, When, and Why to Patch a Module How, When, and Why to Patch a Module
How, When, and Why to Patch a Module
 
Wagner whats buggingyou-voyager
Wagner whats buggingyou-voyagerWagner whats buggingyou-voyager
Wagner whats buggingyou-voyager
 
Upgrading your site from Drupal 6 to Drupal 7
Upgrading your site from Drupal 6 to Drupal 7Upgrading your site from Drupal 6 to Drupal 7
Upgrading your site from Drupal 6 to Drupal 7
 
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal introEdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
 
We4IT lcty 2013 - keynote - worst practices - the best of the worst
We4IT lcty 2013 - keynote - worst practices - the best of the worstWe4IT lcty 2013 - keynote - worst practices - the best of the worst
We4IT lcty 2013 - keynote - worst practices - the best of the worst
 
RabbitMQ Hands On
RabbitMQ Hands OnRabbitMQ Hands On
RabbitMQ Hands On
 
Shut Up And Eat Your Veg
Shut Up And Eat Your VegShut Up And Eat Your Veg
Shut Up And Eat Your Veg
 
Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...
Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...
Synergy 2015 Session Slides: SYN408 XenDesktop 7.6 Architecture - Dealing Wit...
 
Git Makes Me Angry Inside
Git Makes Me Angry InsideGit Makes Me Angry Inside
Git Makes Me Angry Inside
 
Old Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big Bang
Old Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big BangOld Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big Bang
Old Tech to Shiny New Tech: Strategies on Upgrading Your Code Without a Big Bang
 
Happy Content Creators
Happy Content CreatorsHappy Content Creators
Happy Content Creators
 
Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CI
 
Unleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineUnleashing the Rails Asset Pipeline
Unleashing the Rails Asset Pipeline
 
UX, UI, WTF
UX, UI, WTFUX, UI, WTF
UX, UI, WTF
 
The Future is Responsive
The Future is ResponsiveThe Future is Responsive
The Future is Responsive
 
AtlasCamp 2013: ADG / Lean UX
AtlasCamp 2013: ADG / Lean UXAtlasCamp 2013: ADG / Lean UX
AtlasCamp 2013: ADG / Lean UX
 

Mais de Steve Pember

Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
 
SACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices EnvironmentSACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices EnvironmentSteve Pember
 
Surviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSurviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSteve Pember
 
Gradle Show and Tell
Gradle Show and TellGradle Show and Tell
Gradle Show and TellSteve Pember
 
Greach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesGreach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesSteve Pember
 
Reactive All the Way Down the Stack
Reactive All the Way Down the StackReactive All the Way Down the Stack
Reactive All the Way Down the StackSteve Pember
 
Event storage in a distributed system
Event storage in a distributed systemEvent storage in a distributed system
Event storage in a distributed systemSteve Pember
 
Harnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with GroovyHarnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with GroovySteve Pember
 
Surviving in a microservices environment
Surviving in a microservices environmentSurviving in a microservices environment
Surviving in a microservices environmentSteve Pember
 
Surviving in a Microservices Environment
Surviving in a Microservices EnvironmentSurviving in a Microservices Environment
Surviving in a Microservices EnvironmentSteve Pember
 
An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...Steve Pember
 
An Introduction to jOOQ
An Introduction to jOOQAn Introduction to jOOQ
An Introduction to jOOQSteve Pember
 
Reactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovyReactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovySteve Pember
 
A year with event sourcing and CQRS
A year with event sourcing and CQRSA year with event sourcing and CQRS
A year with event sourcing and CQRSSteve Pember
 
An Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVMAn Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVMSteve Pember
 
Reactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovyReactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovySteve Pember
 
Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015Steve Pember
 
Springone2gx 2015 Reactive Options for Groovy
Springone2gx 2015  Reactive Options for GroovySpringone2gx 2015  Reactive Options for Groovy
Springone2gx 2015 Reactive Options for GroovySteve Pember
 
Gr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with GroovyGr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with GroovySteve Pember
 
Gr8conf US 2015: Reactive Options for Groovy
Gr8conf US 2015: Reactive Options for GroovyGr8conf US 2015: Reactive Options for Groovy
Gr8conf US 2015: Reactive Options for GroovySteve Pember
 

Mais de Steve Pember (20)

Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 
SACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices EnvironmentSACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices Environment
 
Surviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSurviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridged
 
Gradle Show and Tell
Gradle Show and TellGradle Show and Tell
Gradle Show and Tell
 
Greach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesGreach 2018: Surviving Microservices
Greach 2018: Surviving Microservices
 
Reactive All the Way Down the Stack
Reactive All the Way Down the StackReactive All the Way Down the Stack
Reactive All the Way Down the Stack
 
Event storage in a distributed system
Event storage in a distributed systemEvent storage in a distributed system
Event storage in a distributed system
 
Harnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with GroovyHarnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with Groovy
 
Surviving in a microservices environment
Surviving in a microservices environmentSurviving in a microservices environment
Surviving in a microservices environment
 
Surviving in a Microservices Environment
Surviving in a Microservices EnvironmentSurviving in a Microservices Environment
Surviving in a Microservices Environment
 
An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...
 
An Introduction to jOOQ
An Introduction to jOOQAn Introduction to jOOQ
An Introduction to jOOQ
 
Reactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovyReactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of Groovy
 
A year with event sourcing and CQRS
A year with event sourcing and CQRSA year with event sourcing and CQRS
A year with event sourcing and CQRS
 
An Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVMAn Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVM
 
Reactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovyReactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of Groovy
 
Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015
 
Springone2gx 2015 Reactive Options for Groovy
Springone2gx 2015  Reactive Options for GroovySpringone2gx 2015  Reactive Options for Groovy
Springone2gx 2015 Reactive Options for Groovy
 
Gr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with GroovyGr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with Groovy
 
Gr8conf US 2015: Reactive Options for Groovy
Gr8conf US 2015: Reactive Options for GroovyGr8conf US 2015: Reactive Options for Groovy
Gr8conf US 2015: Reactive Options for Groovy
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

Message Oriented Architecture - Gr8conf US 2013

  • 1. Thursday, July 25, 13 Hi All. As a warning, those of you with previous RabbitMQ experience may find this a bit boring, as it’s an intro -I won’t try to make anyone guess what this is -I should explain it a bit, as I’ll be following a similar format for other diagrams. -Blue symbol represents some feature - browsing, managing, payments, cart -black box is a single web node or application -cloud is internet
  • 2. https://github.com/spember/gr8conf2013-mq-consumer Thursday, July 25, 13 Make sure to run-app so it grabs all the dependencies
  • 3. Message Oriented Architecture with Rabbit MQ Steve Pember Today, 2013 Thursday, July 25, 13 Let’s talk about complexity and scalability
  • 4. A Few Questions Thursday, July 25, 13 -A few questions, before we begin. -I’d like for you to keep the answers to these in your head as we go along
  • 5. Have you ever... Wondered why your company’s codebase is all in one repo? Thursday, July 25, 13 -or rather, is everything in trunk / master? -Have you ever had to find the needle in that giant haystack?
  • 6. Have you ever... thought “why are there so many #@$!% tables in this database? Thursday, July 25, 13
  • 7. Have you ever... Dreaded executing the unit test suite? Thursday, July 25, 13 -do you miss TDD? Maybe delete this one
  • 8. Have you ever... Gone through a major refactoring of your app? Thursday, July 25, 13 whether it be a total overhaul or just a few features.
  • 9. Have you ever... Adjusted config files to ensure a Quartz job runs only on one load-balanced node? Thursday, July 25, 13 A little esoteric, but.
  • 10. With “Traditional” Monolithic Architecture, One can Reach MVP quickly. Thursday, July 25, 13
  • 11. The entirety of the application’s functionality is in one convenient location. Thursday, July 25, 13
  • 13. Thursday, July 25, 13 The Complexity will become enormous. Any gains you think you may have made at the outset will not continue, particularly once you start to attract users. And grow your team.
  • 14. Won’t scale? WAIT! Thursday, July 25, 13 You may say to yourself, “Wait, Steve!” what do you mean it won’t scale?
  • 15. Thursday, July 25, 13 I can load balance my nodes...
  • 16. Thursday, July 25, 13 Swimlanes, master-slave dbs in case that doesn’t work -or add caching in between my nodes
  • 17. ...Sure, but that’s not what I mean. Thursday, July 25, 13
  • 18. Normal? Thursday, July 25, 13 Can you really look at a class diagram like this and really think, “Yeah, that’s awesome. Nailed it.”? -this was the largest I could find on Google images. I’m sure we’ve all seen the massive versions of this that cover multiple pages, taped to the wall.
  • 19. Thursday, July 25, 13 The ability to add new features, fix bugs, or resolve technical debt cannot scale with the size of the application. Throwing more developers at it also will not help - One of the best passive-aggressive statements I’ve seen - Passive aggressively scrawled on the wall: You can’t make a baby in 1 month with 9 women.
  • 20. Thursday, July 25, 13 -And trying to refactor anything?
  • 21. Thursday, July 25, 13 This has been known for some time, and there’s been papers written on the subject. Although it’s difficult to measure this.
  • 22. Redacted Client Name: A Case Study Thursday, July 25, 13 I’m generally very discrete and don’t mention clients names, especially in presentations, but they explicitly asked me to do this. * Still, redacted it
  • 23. Thursday, July 25, 13 The client was/is a lifestyle brand site. I bit like pintrest -can share, rate, comment on other peoples style. See what’s trendy. -I don’t exactly understand the ‘lifestyle’ term -most importantly, it’s a Grails application
  • 24. Thursday, July 25, 13 Even have some of these ‘lifestyle’ (I don’t get the term) celebreties come in and create custom collections of things to share
  • 25. Thursday, July 25, 13 -we / Cantina were brought in to help recover the application from a remote team. Development had stalled. -the remote team had constructed the application in your traditional sense. (Incidentally, they were making heavy use of Mixins - mixins depending on other mixins - in a large spider web. One change caused dozens and dozens of file compilations. Cautionary tale!)
  • 26. Thursday, July 25, 13 When we first started working on it, this is the basic setup for client. A single monolithic .war file -Product Browsing/ Catalog (Key feature) -Product Curation -User metrics -Social Graph -notifications
  • 27. <sarcasm>Luckily</sarcasm> everything was writing and reading from the same DB. Thursday, July 25, 13 -mention the high-rate rate of the stats
  • 28. Each feature set ran on each node. Thursday, July 25, 13
  • 29. Thursday, July 25, 13 -As you might expect, the original team setup multiple instances of the app and load balanced it. -
  • 30. Heavy caching and balancing mitigated the problems... ... but still under-performant and cumbersome to work with. Thursday, July 25, 13 We added some distributed caching (love ehCache, btw) and few more nodes to the load balancer in order to get some initial wins... -but it wasn’t enough, and very difficult to work with
  • 31. ...and the product owner had ambitious goals Thursday, July 25, 13 Don’t they always?
  • 32. Performance and time hindered growth Thursday, July 25, 13 -The growth of the product was hindered by the classic duo of performance and time. -The site could hardly handle the current traffic. -Member Growth was good, but not good enough.
  • 33. Thursday, July 25, 13 We didn’t want to go down that same old route. -Second thing we did was take a step back and look at their current setup.
  • 34. Enter SOA Thursday, July 25, 13 -our first tactic was to embrace Service Oriented Architecture (that’s what the SOA stands for) -Is everyone familiar with it? -
  • 35. Thursday, July 25, 13 -Let’s take our anecdotal design, an e-commerce store.
  • 36. Thursday, July 25, 13 With SOA, one would break up each individual component, and setup communication between each service over some direct service calls. Eg SOAP or REST. -Synchronous
  • 37. Thursday, July 25, 13 Which keeps the individual components easier to manage and keep track of
  • 38. Decoupling your app into disparate services keeps complexity down... Thursday, July 25, 13
  • 39. ... which creates faster, leaner code ... Thursday, July 25, 13
  • 40. ... which results in rapid long-term development time... Thursday, July 25, 13
  • 41. ... and easier code maintainability... Thursday, July 25, 13
  • 42. ... which saves you Money. Thursday, July 25, 13 and other numbers that managers love
  • 43. Also, it’s fun! l Thursday, July 25, 13
  • 44. Separation of Concerns is a Good Thing. Thursday, July 25, 13 possibly delete
  • 45. However. Thursday, July 25, 13 There’s always a downside, eh?
  • 46. Thursday, July 25, 13 I don’t know who that is, but hold on. I was told he’s kind of a big deal.
  • 47. Following this approach requires an architect to drive the distributed vision and keep folks in line. Y Thursday, July 25, 13 - I can’t stress this enough. Really gotta own it
  • 48. There’s some non-trivial upfront time investing in a service communication format. Thursday, July 25, 13 -find out how each will communicate
  • 49. Intra-Service communication has a cost, particularly if it’s synchronous. Thursday, July 25, 13 The services
  • 50. Thursday, July 25, 13 * Having a web of interconnected services can also grow out of control. Having to configure service nodes so that each knows where the others are located in the network can be cumbersome to manage. *There are tools to help with this, of course. There’s a tool that Twitter released called ‘Figment’ for th *Also, ESB! Enterprise Service Bus, or even an EMB Messaging Bus. *but that adds another layer and potential communication step, although it’s necessary for larger SOA implementations for versioning and management. A bit more on that later.
  • 51. The ‘D’ stands for ‘Decoupled’. Heavily Decoupled. Enter MODA Thursday, July 25, 13 -Message Oriented
  • 52. Thursday, July 25, 13 Your basic approach. A single Producer, a Queue of Messages, and a Consumer. In this case, quite the prodigious one. Note the queue backup. He should probably share.
  • 53. Route Messages asynchronously through a message queue when data needs processing Thursday, July 25, 13 The key to a message oriented approach is when certain events occur to encapsulate data into individual messages and drop them on some queue or exchange
  • 54. Event-based instead of Procedural Thursday, July 25, 13
  • 55. RESTful Messages and Events... ... Consumers only operate on data in the Message. Thursday, July 25, 13 TODO: Image of Postman / message. Only operating on the one thing
  • 56. Add additional nodes to handle load without additional configuration Thursday, July 25, 13
  • 57. Thursday, July 25, 13 -Example from before, an e-commerce site -we’ve broken the features into individual applications and spun up one node per each -connected the users’ cart to a queue, and our order processing into another queue
  • 58. Thursday, July 25, 13 -suppose the cart and order processing start experiencing heavy load - programatically spin up new instances and you’re good -
  • 59. Additional Decoupling { Time w Location u Cardinality Thursday, July 25, 13 TIME: Asynchronous Location: Nodes do not care where the other nodes are, only worry about the broker Cardinality: Nodes do not care about the number of listenersof their messages
  • 60. Data Processing: Use a Message! Data Request: Consider a Service Request Thursday, July 25, 13 Not everything needs to be a message. I argue that a good rule of thumb for a specific event to be a candidate for Message Enqueuing is anything that requires some processing to be done on the event, may require a database write, and can get away with being synchronous. Frankly, anything that’s not saving User Monetary information or dealing with some govt regulation is a good candidate. Now, if you only need to grab some data that’s in another service, you may be able to get away with a direct request.
  • 61. Consider using the Events Push plugin and Async to handle responses for the client Thursday, July 25, 13 Jump back a few slides to comment
  • 62. But which Broker to pick? Thursday, July 25, 13
  • 64. Rabbit MQ Language Agnostic (additional decoupling) Message Persistence Message Recovery Thursday, July 25, 13
  • 66. Slower than other Brokers due to the amazing features. Thursday, July 25, 13
  • 68. spember@cantina.co @svpember Thursday, July 25, 13 If you’re struggling to process 4k+ messages/ second, that sounds like an awesome engineering problem and you contact me.
  • 69. Thursday, July 25, 13 And finally, there’s a fantastic plugin written by Peter Ledbrook and Jeff Brown -Why wouldn’t I choose ActiveMQ? You can’t go wrong, really, if you choose to use that instead. -ActiveMQ plugin isn’t as well maintained as rabbits’. Author says ActiveMQ isn’t “production ready”
  • 70. ... but what about ActiveMQ? Thursday, July 25, 13 This question comes up often. -Overall, you can’t go wrong with ActiveMQ -supports many of the same features as Rabbit, with similar performance -but, clients do not exist for it in as many languages as Rabbit -Minor point: based on JMS ...but...
  • 71. Thursday, July 25, 13 ... The grails plugin isn’t ready yet.
  • 72. ...What about an Enterprise Service Bus? Thursday, July 25, 13 *Some of you have been thinking, “waiiiiitttt... what about just using an ESB?” * Can use one without the other, rabbit would make an excellent addition, working together * Creating an ESB with rabbit would be another talk entirely, I think. * Would be happy to discuss this afterwords!
  • 73. Leaping* Into Rabbit MQ *I’m sorry. Thursday, July 25, 13
  • 74. Thursday, July 25, 13 The previous description of message queues glosses over what is happening a bit. -Messages are routed through an EXCHANGE in to one or many queues. -Messages are then plucked off the queue by an attached, waiting Consumer. Or, the first available if multiple are attached. -Exchanges can have different delivery techniques.
  • 75. Thursday, July 25, 13 If a message is mishandled or the consumer crashes / has an error during message processing, message is returned to the queue for another consumer to pick it up or try again
  • 76. Thursday, July 25, 13 Furthermore, Queues and exchanges can be made “durable”, meaning they’ll survive a restart or server crash with messages intact
  • 77. Thursday, July 25, 13 RabbitMQ nodes can be clustered -federated-> shared / copied -shoveled -> pushed
  • 78. Thursday, July 25, 13 There are several message delivery strategies one can set up for their exchanges
  • 79. Thursday, July 25, 13 With the whole purpose of scaring you, here’s the Topic Queue, the most complicated -gets complicated -allows for all sorts of wild routing schemes -all messages go to the BACK of the queue
  • 80. Thursday, July 25, 13 -may be the most useful, I think
  • 81. Thursday, July 25, 13 Work Queue
  • 82. Thursday, July 25, 13 -Work queues operate on a first-come-first serve approach -I think this is the coolest, one can monitor the state of the exchange and programmatically spin up or down the number of consumer nodes -All of these consumers are peers...
  • 83. Work Queues will likely be your default pattern Thursday, July 25, 13
  • 84. Thursday, July 25, 13 -Finally, there’s ‘fanout’, which distributes a single message to all attached queues. Good for a general broadcast notification / pub-sub to all your nodes. -there needs to be a one-to-one queue to consumer relation, though, I believe. -A special use, case, really.
  • 85. Back to the Story Thursday, July 25, 13 Anyway, back to the story
  • 86. A Sample Diagram: Thursday, July 25, 13 Back to the redacted client. How’d we end up doing it?
  • 87. Thursday, July 25, 13 -describe each node -using only two developers -in addition, they built the browsing as a SPA, and built a native iPhone app against the resulting API
  • 88. Now, Pray to the demo gods. Thursday, July 25, 13
  • 90. Image Credits Complexity (pipes): http://www.flickr.com/photos/bhophoto/384574407/ Simple Pipeline: http://tierracos.com/our-companies/tierra-pipeline/ Highway: http://farnorthdallas.advocatemag.com/wp-content/uploads/2013/04/882349_500402383328407_539732406_o.jpg Homer & doughnuts: http://thechurchillreview.blogspot.com/2012/10/feeling-terror-too-young-aka-kiddie.html Tom Brady: http://stamperdad.wordpress.com/category/tom-brady/ Telephone Exchange Operator: http://fineartamerica.com/featured/telephone-exchange-1920s-granger.html People in Queue: http://www.guardian.co.uk/money/2010/mar/23/dole-queue-jobseekers-online Cookie Monster: http://muppet.wikia.com/wiki/Cookie_Monster_Through_the_Years Scrooge McDuck: http://smallbusiness.uprinting.com/how-pennies-are-hurting-small-business/ Too Many Cooks: http://www.ecommercesystems.com/featured-articles/cooks-kitchen-driving-ecommerce-business/ Clustered Macs: http://www.uiowa.edu/mihpclab/micg.html Resuscitate: http://www.dailymail.co.uk/health/article-2034160/Do-resuscitate-Theyre-fateful-words-meaning-doctors-wont-try-save- you-collapse-hospital.html Iron Man: http://images.wikia.com/marvelmovies Mail Sorting: http://riversidechamber.files.wordpress.com Thursday, July 25, 13