Upload
steve-pember
View
735
Download
4
Tags:
Embed Size (px)
Citation preview
Distributed Reactive Architecture with Rabbit MQ Steve Pember
Today, 2014
A Few Questions
Have you ever...Wondered why your company’s codebase is all in one repo?
Have you ever...
thought “why are there so many #@$!% tables in this database?
Have you ever...
Dreaded executingthe unit test suite?
Have you ever...
Gone through a majorrefactoring of your app?
Have you ever...Gone on an ‘archeological expedition’
on the codebase just to add a new feature?
With “Traditional” Monolithic Architecture,One can Reach MVP quickly.
The entirety of the application’s functionality is in one convenient location.
But that’s it.
Won’t scale?
WAIT!
...Sure, but that’s not what I mean.
Normal?
Architecture choice is more valuable than any framework
Enter SOA
... which creates faster, leaner code ...
... which results in rapid long-term development time...
... and easier code maintainability...
... which saves you Money.
Also, it’s fun! l
Each node can be written without the methods and technologies best suited to
it
Separation of Concerns is a Good Thing.
However.
Following this approach requires an architect to drive the distributed
vision and keep folks in line. Y
There’s some non-trivial upfront time investing in a service communication
format.
Intra-Service communication has a cost, particularly if it’s synchronous.
Becoming Reactive
Event-DrivenScalableResilient
Responsive
“An application must be reactive from top to bottom.”-The Manifesto
Drop synchronous HTTP. Embrace Events.
Message Brokers
Route Messages asynchronously through a message queue when data
needs processing
RESTful Messages and Events...
... Consumers only operate on data in the Message.
Add additional nodes to handle load without additional configuration
Plus Additional Decoupling on…
{
But which Broker to pick?
Rabbit MQLanguage Agnostic (additional decoupling)
Message Persistence
Message Recovery
Slower than other Brokers due to the amazing features.
Especially with Persistence
Leaping* Into Rabbit MQ
*I’m sorry.
Work Queues will likely be your default pattern
The Biggest Case Study
https://blog.twitter.com/2013/new-tweets-per-second-record-and-how
Change was Needed
Monolithic: 200-300 requests/ sec /host
Reactive: 10 - 20K requests / sec / host
During the 2010 World Cup, Twitter hit a record of 3283 TPS
Average 5700 TPSDynamically scale to 143,199 TPS…
With 5x - 12x fewer machines than before
Thank You!
Image CreditsComplexity (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.htmlTom Brady: http://stamperdad.wordpress.com/category/tom-brady/
Telephone Exchange Operator: http://fineartamerica.com/featured/telephone-exchange-1920s-granger.htmlPeople 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_YearsScrooge 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/marvelmoviesMail Sorting: http://riversidechamber.files.wordpress.com
Twitter Logo & app chart: https://blog.twitter.com/engineeringModern Server Farm: http://bookriot.com/2013/03/26/book-less-libraries-and-other-contemporary-realities/
Grey World: http://upload.wikimedia.org/wikipedia/commons/d/d0/BlankMap-World-1ce.png