distributed reactive architecture: extending soa with events

94

Upload: steve-pember

Post on 24-May-2015

732 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Distributed Reactive Architecture: Extending SOA with Events
Page 2: Distributed Reactive Architecture: Extending SOA with Events

Distributed Reactive Architecture with Rabbit MQ Steve Pember

Today, 2014

Page 3: Distributed Reactive Architecture: Extending SOA with Events

A Few Questions

Page 4: Distributed Reactive Architecture: Extending SOA with Events

Have you ever...Wondered why your company’s codebase is all in one repo?

Page 5: Distributed Reactive Architecture: Extending SOA with Events

Have you ever...

thought “why are there so many #@$!% tables in this database?

Page 6: Distributed Reactive Architecture: Extending SOA with Events

Have you ever...

Dreaded executingthe unit test suite?

Page 7: Distributed Reactive Architecture: Extending SOA with Events

Have you ever...

Gone through a majorrefactoring of your app?

Page 8: Distributed Reactive Architecture: Extending SOA with Events

Have you ever...Gone on an ‘archeological expedition’

on the codebase just to add a new feature?

Page 9: Distributed Reactive Architecture: Extending SOA with Events

With “Traditional” Monolithic Architecture,One can Reach MVP quickly.

Page 10: Distributed Reactive Architecture: Extending SOA with Events

The entirety of the application’s functionality is in one convenient location.

Page 11: Distributed Reactive Architecture: Extending SOA with Events

But that’s it.

Page 12: Distributed Reactive Architecture: Extending SOA with Events
Page 13: Distributed Reactive Architecture: Extending SOA with Events

Won’t scale?

WAIT!

Page 14: Distributed Reactive Architecture: Extending SOA with Events
Page 15: Distributed Reactive Architecture: Extending SOA with Events
Page 16: Distributed Reactive Architecture: Extending SOA with Events

...Sure, but that’s not what I mean.

Page 17: Distributed Reactive Architecture: Extending SOA with Events

Normal?

Page 18: Distributed Reactive Architecture: Extending SOA with Events
Page 19: Distributed Reactive Architecture: Extending SOA with Events
Page 20: Distributed Reactive Architecture: Extending SOA with Events
Page 21: Distributed Reactive Architecture: Extending SOA with Events
Page 22: Distributed Reactive Architecture: Extending SOA with Events
Page 23: Distributed Reactive Architecture: Extending SOA with Events
Page 24: Distributed Reactive Architecture: Extending SOA with Events

Architecture choice is more valuable than any framework

Page 25: Distributed Reactive Architecture: Extending SOA with Events

Enter SOA

Page 26: Distributed Reactive Architecture: Extending SOA with Events
Page 27: Distributed Reactive Architecture: Extending SOA with Events
Page 28: Distributed Reactive Architecture: Extending SOA with Events
Page 29: Distributed Reactive Architecture: Extending SOA with Events

... which creates faster, leaner code ...

Page 30: Distributed Reactive Architecture: Extending SOA with Events

... which results in rapid long-term development time...

Page 31: Distributed Reactive Architecture: Extending SOA with Events

... and easier code maintainability...

Page 32: Distributed Reactive Architecture: Extending SOA with Events

... which saves you Money.

Page 33: Distributed Reactive Architecture: Extending SOA with Events

Also, it’s fun! l

Page 34: Distributed Reactive Architecture: Extending SOA with Events

Each node can be written without the methods and technologies best suited to

it

Page 35: Distributed Reactive Architecture: Extending SOA with Events

Separation of Concerns is a Good Thing.

Page 36: Distributed Reactive Architecture: Extending SOA with Events

However.

Page 37: Distributed Reactive Architecture: Extending SOA with Events

Following this approach requires an architect to drive the distributed

vision and keep folks in line. Y

Page 38: Distributed Reactive Architecture: Extending SOA with Events

There’s some non-trivial upfront time investing in a service communication

format.

Page 39: Distributed Reactive Architecture: Extending SOA with Events

Intra-Service communication has a cost, particularly if it’s synchronous.

Page 40: Distributed Reactive Architecture: Extending SOA with Events
Page 41: Distributed Reactive Architecture: Extending SOA with Events
Page 42: Distributed Reactive Architecture: Extending SOA with Events
Page 43: Distributed Reactive Architecture: Extending SOA with Events

Becoming Reactive

Page 44: Distributed Reactive Architecture: Extending SOA with Events

Event-DrivenScalableResilient

Responsive

Page 45: Distributed Reactive Architecture: Extending SOA with Events

“An application must be reactive from top to bottom.”-The Manifesto

Page 46: Distributed Reactive Architecture: Extending SOA with Events
Page 47: Distributed Reactive Architecture: Extending SOA with Events
Page 48: Distributed Reactive Architecture: Extending SOA with Events

Drop synchronous HTTP. Embrace Events.

Page 49: Distributed Reactive Architecture: Extending SOA with Events

Message Brokers

Page 50: Distributed Reactive Architecture: Extending SOA with Events
Page 51: Distributed Reactive Architecture: Extending SOA with Events

Route Messages asynchronously through a message queue when data

needs processing

Page 52: Distributed Reactive Architecture: Extending SOA with Events

RESTful Messages and Events...

... Consumers only operate on data in the Message.

Page 53: Distributed Reactive Architecture: Extending SOA with Events

Add additional nodes to handle load without additional configuration

Page 54: Distributed Reactive Architecture: Extending SOA with Events
Page 55: Distributed Reactive Architecture: Extending SOA with Events
Page 56: Distributed Reactive Architecture: Extending SOA with Events

Plus Additional Decoupling on…

Page 57: Distributed Reactive Architecture: Extending SOA with Events

{

Page 58: Distributed Reactive Architecture: Extending SOA with Events
Page 59: Distributed Reactive Architecture: Extending SOA with Events
Page 60: Distributed Reactive Architecture: Extending SOA with Events

But which Broker to pick?

Page 61: Distributed Reactive Architecture: Extending SOA with Events
Page 62: Distributed Reactive Architecture: Extending SOA with Events

Rabbit MQLanguage Agnostic (additional decoupling)

Message Persistence

Message Recovery

Page 63: Distributed Reactive Architecture: Extending SOA with Events
Page 64: Distributed Reactive Architecture: Extending SOA with Events

Slower than other Brokers due to the amazing features.

Page 65: Distributed Reactive Architecture: Extending SOA with Events

Especially with Persistence

Page 67: Distributed Reactive Architecture: Extending SOA with Events

Leaping* Into Rabbit MQ

*I’m sorry.

Page 68: Distributed Reactive Architecture: Extending SOA with Events
Page 69: Distributed Reactive Architecture: Extending SOA with Events
Page 70: Distributed Reactive Architecture: Extending SOA with Events
Page 71: Distributed Reactive Architecture: Extending SOA with Events
Page 72: Distributed Reactive Architecture: Extending SOA with Events
Page 73: Distributed Reactive Architecture: Extending SOA with Events
Page 74: Distributed Reactive Architecture: Extending SOA with Events
Page 75: Distributed Reactive Architecture: Extending SOA with Events
Page 76: Distributed Reactive Architecture: Extending SOA with Events
Page 77: Distributed Reactive Architecture: Extending SOA with Events

Work Queues will likely be your default pattern

Page 78: Distributed Reactive Architecture: Extending SOA with Events
Page 79: Distributed Reactive Architecture: Extending SOA with Events

The Biggest Case Study

Page 80: Distributed Reactive Architecture: Extending SOA with Events
Page 81: Distributed Reactive Architecture: Extending SOA with Events
Page 82: Distributed Reactive Architecture: Extending SOA with Events
Page 84: Distributed Reactive Architecture: Extending SOA with Events

Change was Needed

Page 85: Distributed Reactive Architecture: Extending SOA with Events
Page 86: Distributed Reactive Architecture: Extending SOA with Events
Page 87: Distributed Reactive Architecture: Extending SOA with Events
Page 88: Distributed Reactive Architecture: Extending SOA with Events

Monolithic: 200-300 requests/ sec /host

Reactive: 10 - 20K requests / sec / host

Page 89: Distributed Reactive Architecture: Extending SOA with Events

During the 2010 World Cup, Twitter hit a record of 3283 TPS

Page 90: Distributed Reactive Architecture: Extending SOA with Events

Average 5700 TPSDynamically scale to 143,199 TPS…

Page 91: Distributed Reactive Architecture: Extending SOA with Events

With 5x - 12x fewer machines than before

Page 92: Distributed Reactive Architecture: Extending SOA with Events

Thank You!

Page 93: Distributed Reactive Architecture: Extending SOA with Events

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

Page 94: Distributed Reactive Architecture: Extending SOA with Events